felicity-lims/webapp/graphql/storage.mutations.ts

251 lines
4.4 KiB
TypeScript
Raw Normal View History

import gql from 'graphql-tag'
// store room
export const ADD_STORE_ROOM= gql`
mutation AddStoreRoom ($payload: StoreRoomInputType!) {
createStoreRoom(payload: $payload){
... on StoreRoomType {
__typename
uid
name
description
}
... on OperationError {
__typename
error
suggestion
}
}
}
`;
export const EDIT_STORE_ROOM= gql`
2023-03-19 23:21:32 +08:00
mutation EditStoreRoom ($uid: FelicityID!, $payload: StoreRoomInputType!) {
updateStoreRoom(uid: $uid, payload: $payload){
... on StoreRoomType {
__typename
uid
name
description
}
... on OperationError {
__typename
error
suggestion
}
}
}
`;
// storage location
export const ADD_STORAGE_LOCATION= gql`
mutation AddStorageLocation ($payload: StorageLocationInputType!) {
createStorageLocation(payload: $payload){
... on StorageLocationType {
__typename
uid
name
description
storeRoomUid
}
... on OperationError {
__typename
error
suggestion
}
}
}
`;
export const EDIT_STORAGE_LOCATION= gql`
2023-03-19 23:21:32 +08:00
mutation EditStorageLocation ($uid: FelicityID!, $payload: StorageLocationInputType!) {
updateStorageLocation(uid: $uid, payload: $payload){
... on StorageLocationType {
__typename
uid
name
description
storeRoomUid
}
... on OperationError {
__typename
error
suggestion
}
}
}
`;
// storage section
export const ADD_STORAGE_SECTION= gql`
mutation AddStorageSection ($payload: StorageSectionInputType!) {
createStorageSection(payload: $payload){
... on StorageSectionType {
__typename
uid
name
description
storageLocationUid
storageLocation {
uid
storeRoomUid
}
}
... on OperationError {
__typename
error
suggestion
}
}
}
`;
export const EDIT_STORAGE_SECTION= gql`
2023-03-19 23:21:32 +08:00
mutation EditStorageSection ($uid: FelicityID!, $payload: StorageSectionInputType!) {
updateStorageSection(uid: $uid, payload: $payload){
... on StorageSectionType {
__typename
uid
name
description
storageLocationUid
storageLocation {
uid
storeRoomUid
}
}
... on OperationError {
__typename
error
suggestion
}
}
}
`;
// storage container
export const ADD_STORAGE_CONTAINER= gql`
mutation AddStorageContainer ($payload: StorageContainerInputType!) {
createStorageContainer(payload: $payload){
... on StorageContainerType {
__typename
uid
name
description
storageSectionUid
storageSection {
uid
storageLocationUid
storageLocation {
uid
storeRoomUid
}
}
grid
rowWise
cols
rows
slots
}
... on OperationError {
__typename
error
suggestion
}
}
}
`;
export const EDIT_STORAGE_CONTAINER= gql`
2023-03-19 23:21:32 +08:00
mutation EditStorageContainer ($uid: FelicityID!, $payload: StorageContainerInputType!) {
updateStorageContainer(uid: $uid, payload: $payload){
... on StorageContainerType {
__typename
uid
name
description
storageSectionUid
storageSection {
uid
storageLocationUid
storageLocation {
uid
storeRoomUid
}
}
grid
rowWise
cols
rows
slots
}
... on OperationError {
__typename
error
suggestion
}
}
}
`;
2023-01-15 14:04:29 +08:00
// sample storage
export const STORE_SAMPLES= gql`
mutation StoreSamples ($payload: [StoreSamplesInputType!]!) {
storeSamples(payload: $payload){
... on StoredSamplesType {
__typename
2023-01-15 14:04:29 +08:00
samples {
uid
sampleId
2023-01-15 14:04:29 +08:00
priority
status
storageSlot
storageContainerUid
}
}
... on OperationError {
__typename
error
suggestion
}
}
}
`;
2023-01-15 14:04:29 +08:00
export const RECOVER_SAMPLES= gql`
mutation RecoverSamples ($sampleUids: [Int!]!) {
recoverSamples(sampleUids: $sampleUids){
... on StoredSamplesType {
__typename
samples {
uid
status
2023-01-15 14:04:29 +08:00
storageSlot
storageContainerUid
}
}
... on OperationError {
__typename
error
suggestion
}
}
}
`;