import { inputObjectType } from 'nexus' import { NexusInputObjectTypeDef } from 'nexus/dist/definitions/inputObjectType' import { z, ZodRawShape } from 'zod' export const createSortingQueryInput = (name: string, sortingInput, definition: (t) => void): NexusInputObjectTypeDef => { return inputObjectType({ name, definition: (t) => { t.nonNull.field('sorting', { type: sortingInput }) definition(t) } }) } export const createSortingQueryInputSchema = (querySchema:z.ZodObject, sortingInputSchema:z.ZodObject) => z.object({ sorting: sortingInputSchema }).merge(querySchema) export type SortingQueryInputType = TQuery & { sorting: TSortingInputType }