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

93 lines
2.2 KiB
TypeScript
Raw Normal View History

2023-04-10 09:29:10 +08:00
import gql from 'graphql-tag';
2021-03-26 04:22:59 +08:00
export const GET_ALL_CLIENTS = gql`
2023-04-10 09:29:10 +08:00
query getAllClients($first: Int, $after: String, $text: String, $sortBy: [String!] = ["uid"]) {
clientAll(pageSize: $first, afterCursor: $after, text: $text, sortBy: $sortBy) {
totalCount
pageInfo {
hasNextPage
hasPreviousPage
startCursor
endCursor
}
items {
2021-03-26 04:22:59 +08:00
uid
name
2023-04-10 09:29:10 +08:00
code
district {
uid
name
province {
uid
name
country {
uid
name
}
}
}
2021-03-26 04:22:59 +08:00
}
}
2023-04-10 09:29:10 +08:00
}
`;
2021-03-26 04:22:59 +08:00
export const SEARCH_CLIENTS = gql`
2023-04-10 09:29:10 +08:00
query searchClients($queryString: String!) {
clientSearch(queryString: $queryString) {
2021-03-26 04:22:59 +08:00
uid
name
2023-04-10 09:29:10 +08:00
code
district {
uid
name
province {
uid
name
country {
uid
name
}
}
2021-03-26 04:22:59 +08:00
}
}
}
2023-04-10 09:29:10 +08:00
`;
2021-03-26 04:22:59 +08:00
export const GET_CLIENT_CONTACTS_BY_CLIENT_UID = gql`
2023-04-10 09:29:10 +08:00
query getClientContactsByClientUid($clientUid: FelicityID!) {
clientContactByClientUid(clientUid: $clientUid) {
uid
firstName
lastName
email
mobilePhone
consentSms
}
2021-03-26 04:22:59 +08:00
}
2023-04-10 09:29:10 +08:00
`;
2021-05-07 01:32:14 +08:00
export const GET_CLIENT_BY_UID = gql`
2023-04-10 09:29:10 +08:00
query getClientByUid($uid: FelicityID!) {
clientByUid(uid: $uid) {
2021-05-07 01:32:14 +08:00
uid
name
2023-04-10 09:29:10 +08:00
code
2023-04-16 19:32:26 +08:00
districtUid
2023-04-10 09:29:10 +08:00
district {
uid
name
2023-04-16 19:32:26 +08:00
provinceUid
2023-04-10 09:29:10 +08:00
province {
uid
name
2023-04-16 19:32:26 +08:00
countryUid
2023-04-10 09:29:10 +08:00
country {
uid
name
}
}
2021-05-07 01:32:14 +08:00
}
}
}
2023-04-10 09:29:10 +08:00
`;