41 lines
801 B
JavaScript
41 lines
801 B
JavaScript
// GraphQL Queries and Mutations
|
|
const GET_BODYSHOP_STATUS = `
|
|
query GetBodyshopStatus($id: uuid!) {
|
|
bodyshops_by_pk(id: $id) {
|
|
md_order_statuses
|
|
}
|
|
}
|
|
`;
|
|
|
|
const GET_VEHICLE_BY_SHOP_VIN = `
|
|
query GetVehicleByShopVin($shopid: uuid!, $v_vin: String!) {
|
|
vehicles(where: { shopid: { _eq: $shopid }, v_vin: { _eq: $v_vin } }, limit: 1) {
|
|
id
|
|
}
|
|
}
|
|
`;
|
|
|
|
const INSERT_OWNER = `
|
|
mutation InsertOwner($owner: owners_insert_input!) {
|
|
insert_owners_one(object: $owner) {
|
|
id
|
|
}
|
|
}
|
|
`;
|
|
|
|
const INSERT_JOB_WITH_LINES = `
|
|
mutation InsertJob($job: jobs_insert_input!) {
|
|
insert_jobs_one(object: $job) {
|
|
id
|
|
joblines { id unq_seq }
|
|
}
|
|
}
|
|
`;
|
|
|
|
module.exports = {
|
|
GET_BODYSHOP_STATUS,
|
|
GET_VEHICLE_BY_SHOP_VIN,
|
|
INSERT_OWNER,
|
|
INSERT_JOB_WITH_LINES
|
|
};
|