52 lines
1.0 KiB
JavaScript
52 lines
1.0 KiB
JavaScript
import gql from "graphql-tag";
|
|
|
|
export const SUBSCRIPTION_SCOREBOARD = gql`
|
|
subscription SUBSCRIPTION_SCOREBOARD($start: date!, $end: date!) {
|
|
scoreboard(where: { _and: { date: { _gte: $start, _lte: $end } } }) {
|
|
id
|
|
painthrs
|
|
bodyhrs
|
|
date
|
|
job {
|
|
id
|
|
ro_number
|
|
|
|
}
|
|
}
|
|
}
|
|
`;
|
|
|
|
export const DELETE_SCOREBOARD_ENTRY = gql`
|
|
mutation DELETE_SCOREBOARD_ENTRY($sbId: uuid!) {
|
|
delete_scoreboard_by_pk(id: $sbId) {
|
|
id
|
|
}
|
|
}
|
|
`;
|
|
export const INSERT_SCOREBOARD_ENTRY = gql`
|
|
mutation INSERT_SCOREBOARD_ENTRY($sbInput: [scoreboard_insert_input!]!) {
|
|
insert_scoreboard(objects: $sbInput) {
|
|
returning {
|
|
id
|
|
date
|
|
bodyhrs
|
|
painthrs
|
|
}
|
|
}
|
|
}
|
|
`;
|
|
|
|
export const UPDATE_SCOREBOARD_ENTRY = gql`
|
|
mutation UPDATE_SCOREBOARD_ENTRY(
|
|
$sbId: uuid!
|
|
$sbInput: scoreboard_set_input!
|
|
) {
|
|
update_scoreboard_by_pk(_set: $sbInput, pk_columns: { id: $sbId }) {
|
|
id
|
|
date
|
|
bodyhrs
|
|
painthrs
|
|
}
|
|
}
|
|
`;
|