import { BasePlugin } from "https://deno.land/x/pothos@release-1719071157/packages/core/plugins/index.ts";
Constructors
new
BasePlugin(buildCache: BuildCache<Types>, name: keyof PothosSchemaTypes.Plugins<Types>)Type Parameters
Types extends SchemaTypes
Methods
protected
createRequestData(context: Types["Context"]): TCreates a data object unique to the current request for use by this plugin
protected
requestData(context: Types["Context"]): TReturns a data object for the current request. requires createRequestData
to be implemented
protected
runUnique<R>(key: unknown, cb: () => R): RafterBuild(schema: GraphQLSchema): GraphQLSchema
Called after all fields and types have been built during builder.toSchema()
onEnumValueConfig(valueConfig: PothosEnumValueConfig<Types>): PothosEnumValueConfig<Types> | null
Called for each Enum value defined in your schema
onInputFieldConfig(fieldConfig: PothosInputFieldConfig<Types>): PothosInputFieldConfig<Types> | null
Called for each argument or field on an Input object defined in your schema
onOutputFieldConfig(fieldConfig: PothosOutputFieldConfig<Types>): PothosOutputFieldConfig<Types> | null
Called for each field on an Object or Interface type
onTypeConfig(typeConfig: PothosTypeConfig): PothosTypeConfig
Called for each type defined with the SchemaBuilder
wrapIsTypeOf(isTypeOf: GraphQLIsTypeOfFn<unknown, Types["Context"]> | undefined, typeConfig: PothosObjectTypeConfig): GraphQLIsTypeOfFn<unknown, Types["Context"]> | undefined
Called with the isTypeOf for each Object type
wrapResolve(resolver: GraphQLFieldResolver<unknown, Types["Context"], object>, fieldConfig: PothosOutputFieldConfig<Types>): GraphQLFieldResolver<unknown, Types["Context"], object>
Called with the resolver for each field in the schema
wrapResolveType(resolveType: GraphQLTypeResolver<unknown, Types["Context"]>, typeConfig: PothosInterfaceTypeConfig | PothosUnionTypeConfig): GraphQLTypeResolver<unknown, Types["Context"]>
Called with the resolveType for each Interface or Union type
wrapSubscribe(subscribe: GraphQLFieldResolver<unknown, Types["Context"], object> | undefined, fieldConfig: PothosOutputFieldConfig<Types>): GraphQLFieldResolver<unknown, Types["Context"], object> | undefined
Called with the subscribe for each field on the Subscription type