First prototype of image upload working. IO-397 IO-398
This commit is contained in:
46
graphql/documents.queries.js
Normal file
46
graphql/documents.queries.js
Normal file
@@ -0,0 +1,46 @@
|
||||
import gql from "graphql-tag";
|
||||
|
||||
export const GET_DOCUMENTS_BY_JOB = gql`
|
||||
query GET_DOCUMENTS_BY_JOB($jobId: uuid!) {
|
||||
documents(
|
||||
where: { jobid: { _eq: $jobId } }
|
||||
order_by: { updated_at: desc }
|
||||
) {
|
||||
id
|
||||
name
|
||||
key
|
||||
type
|
||||
bill {
|
||||
id
|
||||
invoice_number
|
||||
date
|
||||
vendor {
|
||||
id
|
||||
name
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const INSERT_NEW_DOCUMENT = gql`
|
||||
mutation INSERT_NEW_DOCUMENT($docInput: [documents_insert_input!]!) {
|
||||
insert_documents(objects: $docInput) {
|
||||
returning {
|
||||
id
|
||||
name
|
||||
key
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const DELETE_DOCUMENT = gql`
|
||||
mutation DELETE_DOCUMENT($id: uuid) {
|
||||
delete_documents(where: { id: { _eq: $id } }) {
|
||||
returning {
|
||||
id
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
Reference in New Issue
Block a user