import { GraphQLFieldResolver, GraphQLSchema, GraphQLTypeResolver } from 'graphql'; import { GiraphQLEnumValueConfig, GiraphQLInputFieldConfig, GiraphQLInterfaceTypeConfig, GiraphQLOutputFieldConfig, GiraphQLTypeConfig, GiraphQLUnionTypeConfig, SchemaTypes } from '../types'; import { BuildCache } from '..'; export declare class BasePlugin { name: never; builder: GiraphQLSchemaTypes.SchemaBuilder; buildCache: BuildCache; options: GiraphQLSchemaTypes.BuildSchemaOptions; private requestDataMap; constructor(buildCache: BuildCache, name: keyof GiraphQLSchemaTypes.Plugins); /** * Called for each type defined with the SchemaBuilder * @param {GiraphQLTypeConfig} typeConfig - Config object describing the added type * @return {GiraphQLTypeConfig} Original or updated `typeConfig` */ onTypeConfig(typeConfig: GiraphQLTypeConfig): GiraphQLTypeConfig; /** * Called for each field on an Object or Interface type * @param {GiraphQLOutputFieldConfig} fieldConfig - Config object describing the added field * @return {GiraphQLOutputFieldConfig} Original or updated `fieldConfig` */ onOutputFieldConfig(fieldConfig: GiraphQLOutputFieldConfig): GiraphQLOutputFieldConfig | null; /** * Called for each argument or field on an Input object defined in your schema * @param {GiraphQLInputFieldConfig} fieldConfig - Config object describing the added field * @return {GiraphQLInputFieldConfig} Original or updated `fieldConfig` */ onInputFieldConfig(fieldConfig: GiraphQLInputFieldConfig): GiraphQLInputFieldConfig | null; /** * Called for each Enum value defined in your schema * @param {GiraphQLEnumValueConfig} valueConfig - Config object describing the enum value * @return {GiraphQLEnumValueConfig} Original or updated `valueConfig` */ onEnumValueConfig(valueConfig: GiraphQLEnumValueConfig): GiraphQLEnumValueConfig | null; /** * Called before builder.toSchema() schema is called */ beforeBuild(): void; /** * Called after all fields and types have been built during `builder.toSchema()` * @param {GraphQLSchema} schema - the generated schema * @return {GiraphQLEnumValueConfig} Original or updated `schema` */ afterBuild(schema: GraphQLSchema): GraphQLSchema; /** * Called with the resolver for each field in the schema * @param {GraphQLFieldResolver} resolve - the resolve function * @param {GiraphQLOutputFieldConfig} fieldConfig - the config object for the field associated with this resolve function * @return {GraphQLFieldResolver} - Either the original, or a new resolver function to use for this field */ wrapResolve(resolver: GraphQLFieldResolver, fieldConfig: GiraphQLOutputFieldConfig): GraphQLFieldResolver; /** * Called with the subscribe for each field on the Subscription type * @param {GraphQLFieldResolver} subscribe - the subscribe function * @param {GiraphQLOutputFieldConfig} fieldConfig - the config object for the field associated with this subscribe function * @return {GraphQLFieldResolver} - Either the original, or a new subscribe function to use for this field */ wrapSubscribe(subscribe: GraphQLFieldResolver | undefined, fieldConfig: GiraphQLOutputFieldConfig): GraphQLFieldResolver | undefined; /** * Called with the resolveType for each Interface or Union type * @param {GraphQLTypeResolver} resolveType - the resolveType function * @param {GiraphQLInterfaceTypeConfig | GiraphQLUnionTypeConfig} typeConfig - the config object for the Interface or Union type * @return {GraphQLTypeResolver} - Either the original, or a new resolveType function to use for this field */ wrapResolveType(resolveType: GraphQLTypeResolver, typeConfig: GiraphQLInterfaceTypeConfig | GiraphQLUnionTypeConfig): GraphQLTypeResolver; protected runUnique(key: unknown, cb: () => R): R; /** * Creates a data object unique to the current request for use by this plugin * @param {Types['Context']} context - the context object for the current request * @return {object} - The data object for the current request */ protected createRequestData(context: Types['Context']): T; /** * Returns a data object for the current request. requires `createRequestData` to be implemented * @param {Types['Context']} context - the context object for the current request * @return {object} - The data object for the current request */ protected requestData(context: Types['Context']): T; } //# sourceMappingURL=plugin.d.ts.map