UNPKG

@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.12 kB
import gql from 'graphql-tag'; import { expertiserFieldsFragment, } from "./fragments"; export const fragmentExpertiser = ` fragment expertiser on Expertiser { ...expertiserFields } ${expertiserFieldsFragment} `; export const expertisersConnection = gql` query expertisersConnection( $first:Int $skip:Int $orderBy: ExpertiserOrderByInput $where:ExpertiserWhereInput ){ objectsConnection:expertisersConnection( first: $first skip: $skip orderBy: $orderBy where:$where ){ pageInfo{ hasNextPage hasPreviousPage startCursor endCursor } aggregate{ count } edges{ node{ ...expertiser } } } } ${fragmentExpertiser} `; export const expertisers = gql` query expertisers( $first:Int $skip:Int $orderBy: ExpertiserOrderByInput $where:ExpertiserWhereInput ){ objects:expertisers( first: $first skip: $skip orderBy: $orderBy where:$where ){ ...expertiser } } ${fragmentExpertiser} `; export const expertiser = gql` query expertiserByExpertisername( $where:ExpertiserWhereUniqueInput! ){ object:expertiser( where:$where ){ ...expertiser } } ${fragmentExpertiser} `; export const updateExpertiserProcessor = gql` mutation updateExpertiserProcessor( $data: ExpertiserUpdateInput! $where: ExpertiserWhereUniqueInput! ){ response: updateExpertiserProcessor( where: $where data: $data ){ success message errors{ key message } data{ ...expertiser } } } ${fragmentExpertiser} `; export const createExpertiserProcessor = gql` mutation createExpertiserProcessor( $data: ExpertiserCreateInput! ){ response: createExpertiserProcessor( data: $data ){ success message errors{ key message } data{ ...expertiser } } } ${fragmentExpertiser} `;