IO-924 Rest of phonebook implementation
This commit is contained in:
@@ -84,6 +84,44 @@ export const INSERT_EXPORT_LOG = gql`
|
||||
}
|
||||
`;
|
||||
|
||||
export const QUERY_PHONEBOOK_PAGINATED = gql`
|
||||
query QUERY_PHONEBOOK_PAGINATED(
|
||||
$search: String
|
||||
$offset: Int
|
||||
$limit: Int
|
||||
$order: [phonebook_order_by!]
|
||||
) {
|
||||
search_phonebook(
|
||||
offset: $offset
|
||||
limit: $limit
|
||||
order_by: $order
|
||||
args: { search: $search }
|
||||
) {
|
||||
id
|
||||
created_at
|
||||
firstname
|
||||
lastname
|
||||
phone1
|
||||
phone2
|
||||
state
|
||||
zip
|
||||
fax
|
||||
email
|
||||
country
|
||||
company
|
||||
city
|
||||
category
|
||||
address2
|
||||
address1
|
||||
}
|
||||
search_phonebook_aggregate(args: { search: $search }) {
|
||||
aggregate {
|
||||
count(distinct: true)
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const QUERY_EXPORT_LOG_PAGINATED = gql`
|
||||
query QUERY_ALL_EXPORTLOG_PAGINATED(
|
||||
$search: String
|
||||
|
||||
92
client/src/graphql/phonebook.queries.js
Normal file
92
client/src/graphql/phonebook.queries.js
Normal file
@@ -0,0 +1,92 @@
|
||||
import { gql } from "@apollo/client";
|
||||
|
||||
export const QUERY_PHONEBOOK_PAGINATED = gql`
|
||||
query QUERY_PHONEBOOK_PAGINATED(
|
||||
$search: String
|
||||
$offset: Int
|
||||
$limit: Int
|
||||
$order: [phonebook_order_by!]
|
||||
) {
|
||||
search_phonebook(
|
||||
offset: $offset
|
||||
limit: $limit
|
||||
order_by: $order
|
||||
args: { search: $search }
|
||||
) {
|
||||
id
|
||||
created_at
|
||||
firstname
|
||||
lastname
|
||||
phone1
|
||||
phone2
|
||||
state
|
||||
zip
|
||||
fax
|
||||
email
|
||||
country
|
||||
company
|
||||
city
|
||||
category
|
||||
address2
|
||||
address1
|
||||
}
|
||||
search_phonebook_aggregate(args: { search: $search }) {
|
||||
aggregate {
|
||||
count(distinct: true)
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const QUERY_PHONEBOOK_BY_ID = gql`
|
||||
query QUERY_PHONEBOOK_BY_ID($id: uuid!) {
|
||||
phonebook_by_pk(id: $id) {
|
||||
id
|
||||
created_at
|
||||
firstname
|
||||
lastname
|
||||
phone1
|
||||
phone2
|
||||
state
|
||||
zip
|
||||
fax
|
||||
email
|
||||
country
|
||||
company
|
||||
city
|
||||
category
|
||||
address2
|
||||
address1
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const UPDATE_PHONEBOOK = gql`
|
||||
mutation UPDATE_VENDOR($id: uuid!, $phonebook: phonebook_set_input!) {
|
||||
update_phonebook(where: { id: { _eq: $id } }, _set: $phonebook) {
|
||||
returning {
|
||||
id
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const INSERT_NEW_PHONEBOOK = gql`
|
||||
mutation INSERT_NEW_PHONEBOOK($phonebook_entry: [phonebook_insert_input!]!) {
|
||||
insert_phonebook(objects: $phonebook_entry) {
|
||||
returning {
|
||||
id
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const DELETE_PHONEBOOK = gql`
|
||||
mutation DELETE_PHONEBOOK($id: uuid!) {
|
||||
delete_phonebook(where: { id: { _eq: $id } }) {
|
||||
returning {
|
||||
id
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
Reference in New Issue
Block a user