@@ -1,129 +1,129 @@
|
||||
import { gql } from "@apollo/client";
|
||||
import {gql} from "@apollo/client";
|
||||
|
||||
export const QUERY_VENDOR_BY_ID = gql`
|
||||
query QUERY_VENDOR_BY_ID($id: uuid!) {
|
||||
vendors_by_pk(id: $id) {
|
||||
zip
|
||||
street2
|
||||
state
|
||||
name
|
||||
id
|
||||
favorite
|
||||
email
|
||||
due_date
|
||||
discount
|
||||
country
|
||||
cost_center
|
||||
city
|
||||
street1
|
||||
active
|
||||
phone
|
||||
dmsid
|
||||
query QUERY_VENDOR_BY_ID($id: uuid!) {
|
||||
vendors_by_pk(id: $id) {
|
||||
zip
|
||||
street2
|
||||
state
|
||||
name
|
||||
id
|
||||
favorite
|
||||
email
|
||||
due_date
|
||||
discount
|
||||
country
|
||||
cost_center
|
||||
city
|
||||
street1
|
||||
active
|
||||
phone
|
||||
dmsid
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
export const CHECK_VENDOR_NAME = gql`
|
||||
query CHECK_VENDOR_NAME($name: String!) {
|
||||
vendors_aggregate(where: { name: { _ilike: $name } }) {
|
||||
aggregate {
|
||||
count
|
||||
}
|
||||
nodes {
|
||||
id
|
||||
}
|
||||
query CHECK_VENDOR_NAME($name: String!) {
|
||||
vendors_aggregate(where: { name: { _ilike: $name } }) {
|
||||
aggregate {
|
||||
count
|
||||
}
|
||||
nodes {
|
||||
id
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const UPDATE_VENDOR = gql`
|
||||
mutation UPDATE_VENDOR($id: uuid!, $vendor: vendors_set_input!) {
|
||||
update_vendors(where: { id: { _eq: $id } }, _set: $vendor) {
|
||||
returning {
|
||||
id
|
||||
}
|
||||
mutation UPDATE_VENDOR($id: uuid!, $vendor: vendors_set_input!) {
|
||||
update_vendors(where: { id: { _eq: $id } }, _set: $vendor) {
|
||||
returning {
|
||||
id
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const QUERY_ALL_VENDORS = gql`
|
||||
query QUERY_ALL_VENDORS {
|
||||
vendors(order_by: { name: asc }) {
|
||||
name
|
||||
id
|
||||
cost_center
|
||||
city
|
||||
phone
|
||||
active
|
||||
query QUERY_ALL_VENDORS {
|
||||
vendors(order_by: { name: asc }) {
|
||||
name
|
||||
id
|
||||
cost_center
|
||||
city
|
||||
phone
|
||||
active
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const INSERT_NEW_VENDOR = gql`
|
||||
mutation INSERT_NEW_VENDOR($vendorInput: [vendors_insert_input!]!) {
|
||||
insert_vendors(objects: $vendorInput) {
|
||||
returning {
|
||||
id
|
||||
}
|
||||
mutation INSERT_NEW_VENDOR($vendorInput: [vendors_insert_input!]!) {
|
||||
insert_vendors(objects: $vendorInput) {
|
||||
returning {
|
||||
id
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const DELETE_VENDOR = gql`
|
||||
mutation DELETE_VENDOR($id: uuid!) {
|
||||
delete_vendors(where: { id: { _eq: $id } }) {
|
||||
returning {
|
||||
id
|
||||
}
|
||||
mutation DELETE_VENDOR($id: uuid!) {
|
||||
delete_vendors(where: { id: { _eq: $id } }) {
|
||||
returning {
|
||||
id
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const QUERY_ALL_VENDORS_FOR_ORDER = gql`
|
||||
query QUERY_ALL_VENDORS_FOR_ORDER($jobId: uuid) {
|
||||
vendors(order_by: { name: asc }, where: { active: { _eq: true } }) {
|
||||
name
|
||||
cost_center
|
||||
id
|
||||
favorite
|
||||
discount
|
||||
email
|
||||
active
|
||||
phone
|
||||
query QUERY_ALL_VENDORS_FOR_ORDER($jobId: uuid) {
|
||||
vendors(order_by: { name: asc }, where: { active: { _eq: true } }) {
|
||||
name
|
||||
cost_center
|
||||
id
|
||||
favorite
|
||||
discount
|
||||
email
|
||||
active
|
||||
phone
|
||||
}
|
||||
jobs(where: { id: { _eq: $jobId } }) {
|
||||
v_make_desc
|
||||
}
|
||||
}
|
||||
jobs(where: { id: { _eq: $jobId } }) {
|
||||
v_make_desc
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const SEARCH_VENDOR_AUTOCOMPLETE = gql`
|
||||
query SEARCH_VENDOR_AUTOCOMPLETE {
|
||||
vendors(order_by: { name: asc }, where: { active: { _eq: true } }) {
|
||||
name
|
||||
discount
|
||||
id
|
||||
cost_center
|
||||
active
|
||||
favorite
|
||||
query SEARCH_VENDOR_AUTOCOMPLETE {
|
||||
vendors(order_by: { name: asc }, where: { active: { _eq: true } }) {
|
||||
name
|
||||
discount
|
||||
id
|
||||
cost_center
|
||||
active
|
||||
favorite
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const SEARCH_VENDOR_AUTOCOMPLETE_WITH_ADDR = gql`
|
||||
query SEARCH_VENDOR_AUTOCOMPLETE_WITH_ADDR {
|
||||
vendors(order_by: { name: asc }, where: { active: { _eq: true } }) {
|
||||
name
|
||||
discount
|
||||
id
|
||||
cost_center
|
||||
street1
|
||||
street2
|
||||
zip
|
||||
country
|
||||
city
|
||||
email
|
||||
state
|
||||
active
|
||||
query SEARCH_VENDOR_AUTOCOMPLETE_WITH_ADDR {
|
||||
vendors(order_by: { name: asc }, where: { active: { _eq: true } }) {
|
||||
name
|
||||
discount
|
||||
id
|
||||
cost_center
|
||||
street1
|
||||
street2
|
||||
zip
|
||||
country
|
||||
city
|
||||
email
|
||||
state
|
||||
active
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
Reference in New Issue
Block a user