Function: mutation()

mutation<TOutput, TInput>(output, resolveOrOptions): FieldOrOperation<undefined, SchemaToSilk<GraphQLSilkIO | ZodSchemaIO, TOutput>, InputSchemaToSilk<GraphQLSilkIO | ZodSchemaIO, TInput>, "mutation">

Type Parameters

TOutput extends GraphQLSilk<any, any> | ZodType<any, ZodTypeDef, any>

TInput extends InputSchema<GraphQLSilk<any, any> | ZodType<any, ZodTypeDef, any>> = undefined

Parameters

output: TOutput

resolveOrOptions: QueryMutationOptions<GraphQLSilkIO | ZodSchemaIO, TOutput, TInput> | () => MayPromise<"~standard" extends keyof TOutput ? "types" extends keyof NonNullable<TOutput[keyof ... & "~standard"]> ? "output" extends keyof NonNullable<NonNullable<...>[... & ...]> ? NonNullable<NonNullable<...>[... & ...]>[keyof NonNullable<...> & "output"] : never : never : never | "_output" extends keyof TOutput ? TOutput[keyof TOutput & "_output"] : never>

Returns

FieldOrOperation<undefined, SchemaToSilk<GraphQLSilkIO | ZodSchemaIO, TOutput>, InputSchemaToSilk<GraphQLSilkIO | ZodSchemaIO, TInput>, "mutation">

Defined in

packages/zod/src/index.ts:465