Added my shop page and ability to add, edit and delete employees.

This commit is contained in:
Patrick Fic
2020-02-10 12:45:20 -08:00
parent 9d9de14cf0
commit cac3716e03
42 changed files with 1444 additions and 52 deletions

View File

@@ -0,0 +1,48 @@
import { gql } from "apollo-boost";
export const QUERY_EMPLOYEES = gql`
query QUERY_EMPLOYEES {
employees {
last_name
id
first_name
employee_number
active
termination_date
hire_date
flat_rate
cost_center
base_rate
}
}
`;
export const INSERT_EMPLOYEES = gql`
mutation INSERT_EMPLOYEES($employees: [employees_insert_input!]!) {
insert_employees(objects: $employees) {
returning {
id
}
}
}
`;
export const UPDATE_EMPLOYEE = gql`
mutation UPDATE_EMPLOYEE($id: uuid!, $employee: employees_set_input) {
update_employees(where: { id: { _eq: $id } }, _set: $employee) {
returning {
id
}
}
}
`;
export const DELETE_EMPLOYEE = gql`
mutation DELETE_EMPLOYEE($id: uuid!) {
delete_employees(where: { id: { _eq: $id } }) {
returning {
id
}
}
}
`;