@@ -1,97 +1,97 @@
|
||||
import { gql } from "@apollo/client";
|
||||
import {gql} from "@apollo/client";
|
||||
|
||||
export const QUERY_SURVEY = gql`
|
||||
query QUERY_SURVEY($surveyId: uuid!) {
|
||||
csi_by_pk(id: $surveyId) {
|
||||
relateddata
|
||||
valid
|
||||
validuntil
|
||||
id
|
||||
csiquestion {
|
||||
id
|
||||
config
|
||||
}
|
||||
query QUERY_SURVEY($surveyId: uuid!) {
|
||||
csi_by_pk(id: $surveyId) {
|
||||
relateddata
|
||||
valid
|
||||
validuntil
|
||||
id
|
||||
csiquestion {
|
||||
id
|
||||
config
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
export const COMPLETE_SURVEY = gql`
|
||||
mutation COMPLETE_SURVEY($surveyId: uuid!, $survey: csi_set_input) {
|
||||
update_csi(where: { id: { _eq: $surveyId } }, _set: $survey) {
|
||||
affected_rows
|
||||
mutation COMPLETE_SURVEY($surveyId: uuid!, $survey: csi_set_input) {
|
||||
update_csi(where: { id: { _eq: $surveyId } }, _set: $survey) {
|
||||
affected_rows
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const GET_ALL_QUESTION_SETS = gql`
|
||||
query GET_ALL_QUESTION_SETS {
|
||||
csiquestions(order_by: { created_at: desc }) {
|
||||
id
|
||||
created_at
|
||||
config
|
||||
current
|
||||
csis_aggregate {
|
||||
aggregate {
|
||||
count
|
||||
query GET_ALL_QUESTION_SETS {
|
||||
csiquestions(order_by: { created_at: desc }) {
|
||||
id
|
||||
created_at
|
||||
config
|
||||
current
|
||||
csis_aggregate {
|
||||
aggregate {
|
||||
count
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const GET_CURRENT_QUESTIONSET_ID = gql`
|
||||
query GET_CURRENT_QUESTIONSET_ID {
|
||||
csiquestions(where: { current: { _eq: true } }) {
|
||||
id
|
||||
query GET_CURRENT_QUESTIONSET_ID {
|
||||
csiquestions(where: { current: { _eq: true } }) {
|
||||
id
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const INSERT_CSI = gql`
|
||||
mutation INSERT_CSI($csiInput: [csi_insert_input!]!) {
|
||||
insert_csi(objects: $csiInput) {
|
||||
returning {
|
||||
id
|
||||
}
|
||||
mutation INSERT_CSI($csiInput: [csi_insert_input!]!) {
|
||||
insert_csi(objects: $csiInput) {
|
||||
returning {
|
||||
id
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const QUERY_CSI_RESPONSE_PAGINATED = gql`
|
||||
query QUERY_CSI_RESPONSE_PAGINATED(
|
||||
$offset: Int
|
||||
$limit: Int
|
||||
$order: [csi_order_by!]!
|
||||
) {
|
||||
csi(offset: $offset, limit: $limit, order_by: $order) {
|
||||
id
|
||||
completedon
|
||||
job {
|
||||
ownr_fn
|
||||
ownr_ln
|
||||
ro_number
|
||||
query QUERY_CSI_RESPONSE_PAGINATED(
|
||||
$offset: Int
|
||||
$limit: Int
|
||||
$order: [csi_order_by!]!
|
||||
) {
|
||||
csi(offset: $offset, limit: $limit, order_by: $order) {
|
||||
id
|
||||
completedon
|
||||
job {
|
||||
ownr_fn
|
||||
ownr_ln
|
||||
ro_number
|
||||
|
||||
id
|
||||
}
|
||||
id
|
||||
}
|
||||
}
|
||||
csi_aggregate {
|
||||
aggregate {
|
||||
count(distinct: true)
|
||||
}
|
||||
}
|
||||
}
|
||||
csi_aggregate {
|
||||
aggregate {
|
||||
count(distinct: true)
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
export const QUERY_CSI_RESPONSE_BY_PK = gql`
|
||||
query QUERY_CSI_RESPONSE_BY_PK($id: uuid!) {
|
||||
csi_by_pk(id: $id) {
|
||||
relateddata
|
||||
valid
|
||||
validuntil
|
||||
id
|
||||
response
|
||||
csiquestion {
|
||||
id
|
||||
config
|
||||
}
|
||||
query QUERY_CSI_RESPONSE_BY_PK($id: uuid!) {
|
||||
csi_by_pk(id: $id) {
|
||||
relateddata
|
||||
valid
|
||||
validuntil
|
||||
id
|
||||
response
|
||||
csiquestion {
|
||||
id
|
||||
config
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
Reference in New Issue
Block a user