Function: field()

field<TParent, TOutput, TInput>(output, resolveOrOptions): FieldOrOperation<SchemaToSilk<GraphQLSilkIO | YupSchemaIO, TParent>, SchemaToSilk<GraphQLSilkIO | YupSchemaIO, TOutput>, InputSchemaToSilk<GraphQLSilkIO | YupSchemaIO, TInput>, "field">

Type Parameters

TParent extends GraphQLSilk<any, any> | Schema<any, any, any, "">

TOutput extends GraphQLSilk<any, any> | Schema<any, any, any, "">

TInput extends InputSchema<GraphQLSilk<any, any> | Schema<any, any, any, "">> = undefined

Parameters

output: TOutput

resolveOrOptions: FieldOptions<GraphQLSilkIO | YupSchemaIO, TParent, TOutput, TInput> | (parent) => 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 | "__outputType" extends keyof TOutput ? TOutput[keyof TOutput & "__outputType"] : never>

Returns

FieldOrOperation<SchemaToSilk<GraphQLSilkIO | YupSchemaIO, TParent>, SchemaToSilk<GraphQLSilkIO | YupSchemaIO, TOutput>, InputSchemaToSilk<GraphQLSilkIO | YupSchemaIO, TInput>, "field">

Defined in

packages/yup/src/index.ts:383