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

128 lines
3.1 KiB
TypeScript
Raw Normal View History

import gql from 'graphql-tag';
export const ADD_CLIENT = gql`
mutation AddClient($payload: ClientInputType!) {
createClient(payload: $payload) {
... on ClientType {
__typename
uid
name
code
districtUid
district {
uid
name
province {
uid
name
country {
uid
name
}
}
}
}
... on OperationError {
__typename
error
suggestion
}
}
}
`;
export const EDIT_CLIENT = gql`
2023-05-12 02:35:42 +08:00
mutation editClient($uid: String!, $payload: ClientInputType!) {
updateClient(uid: $uid, payload: $payload) {
... on ClientType {
__typename
uid
name
code
districtUid
district {
uid
name
province {
uid
name
country {
uid
name
}
}
}
}
... on OperationError {
__typename
error
suggestion
}
}
}
`;
export const ADD_CLIENT_CONTACT = gql`
mutation AddClientContact($payload: ClientContactInputType!) {
createClientContact(payload: $payload) {
... on ClientContactType {
__typename
uid
firstName
lastName
email
mobilePhone
consentSms
}
... on OperationError {
__typename
error
suggestion
}
}
}
`;
export const EDIT_CLIENT_CONTACT = gql`
2023-05-12 02:35:42 +08:00
mutation editClientContact($uid: String!, $payload: ClientContactInputType!) {
updateClientContact(uid: $uid, payload: $payload) {
... on ClientContactType {
__typename
uid
firstName
lastName
email
mobilePhone
consentSms
}
... on OperationError {
__typename
error
suggestion
}
}
}
`;
export const DELETE_CLIENT_CONTACT = gql`
2023-05-12 02:35:42 +08:00
mutation deleteClientContact($uid: String!) {
deleteClientContact(uid: $uid) {
... on DeletedItem {
uid
}
... on OperationError {
__typename
error
suggestion
}
}
}
`;