@rnga/orders
Version:
## Get schema from @prisma-cms 1. yarn get-api-schema -e http://localhost:4000 2. yarn build-api-fragments
145 lines (113 loc) • 2.08 kB
JavaScript
import gql from 'graphql-tag';
import {
expertiseFieldsFragment,
} from "./fragments";
export const fragmentExpertise = `
fragment expertise on Expertise {
...expertiseFields
}
${expertiseFieldsFragment}
`;
export const expertisesConnection = gql`
query expertisesConnection(
$first:Int
$skip:Int
$orderBy: ExpertiseOrderByInput
$where:ExpertiseWhereInput
){
objectsConnection:expertisesConnection(
first: $first
skip: $skip
orderBy: $orderBy
where:$where
){
pageInfo{
hasNextPage
hasPreviousPage
startCursor
endCursor
}
aggregate{
count
}
edges{
node{
...expertise
}
}
}
}
${fragmentExpertise}
`;
export const expertises = gql`
query expertises(
$first:Int
$skip:Int
$orderBy: ExpertiseOrderByInput
$where:ExpertiseWhereInput
){
objects:expertises(
first: $first
skip: $skip
orderBy: $orderBy
where:$where
){
...expertise
}
}
${fragmentExpertise}
`;
export const expertise = gql`
query expertiseByExpertisename(
$where:ExpertiseWhereUniqueInput!
){
object:expertise(
where:$where
){
...expertise
}
}
${fragmentExpertise}
`;
export const updateExpertiseProcessor = gql`
mutation updateExpertiseProcessor(
$data: ExpertiseUpdateInput!
$where: ExpertiseWhereUniqueInput!
){
response: updateExpertiseProcessor(
where: $where
data: $data
){
success
message
errors{
key
message
}
data{
...expertise
}
}
}
${fragmentExpertise}
`;
export const createExpertiseProcessor = gql`
mutation createExpertiseProcessor(
$data: ExpertiseCreateInput!
){
response: createExpertiseProcessor(
data: $data
){
success
message
errors{
key
message
}
data{
...expertise
}
}
}
${fragmentExpertise}
`;