Catch the highlights of GraphQLConf 2023! Click for recordings. Or check out our recap blog post.
Docs
API Reference
Packages
wrap

@graphql-tools/wrap

Classes

Type Aliases

Functions

Type Aliases

DataTransformer

Ƭ DataTransformer: (value: any, transformationContext: Record<string, any>) => any

Type declaration

▸ (value, transformationContext): any

Parameters
NameType
valueany
transformationContextRecord<string, any>
Returns

any

Defined in

packages/wrap/src/types.ts:64


EnumValueTransformer

Ƭ EnumValueTransformer: (typeName: string, externalValue: string, enumValueConfig: GraphQLEnumValueConfig) => Maybe<GraphQLEnumValueConfig | [string, GraphQLEnumValueConfig]>

Type declaration

▸ (typeName, externalValue, enumValueConfig): Maybe<GraphQLEnumValueConfig | [string, GraphQLEnumValueConfig]>

Parameters
NameType
typeNamestring
externalValuestring
enumValueConfigGraphQLEnumValueConfig
Returns

Maybe<GraphQLEnumValueConfig | [string, GraphQLEnumValueConfig]>

Defined in

packages/wrap/src/types.ts:48


ErrorsTransformer

Ƭ ErrorsTransformer: (errors: ReadonlyArray<GraphQLError> | undefined, transformationContext: Record<string, any>) => GraphQLError[] | undefined

Type declaration

▸ (errors, transformationContext): GraphQLError[] | undefined

Parameters
NameType
errorsReadonlyArray<GraphQLError> | undefined
transformationContextRecord<string, any>
Returns

GraphQLError[] | undefined

Defined in

packages/wrap/src/types.ts:68


FieldNodeTransformer

Ƭ FieldNodeTransformer: (typeName: string, fieldName: string, fieldNode: FieldNode, fragments: Record<string, FragmentDefinitionNode>, transformationContext: Record<string, any>) => Maybe<SelectionNode | SelectionNode[]>

Type declaration

▸ (typeName, fieldName, fieldNode, fragments, transformationContext): Maybe<SelectionNode | SelectionNode[]>

Parameters
NameType
typeNamestring
fieldNamestring
fieldNodeFieldNode
fragmentsRecord<string, FragmentDefinitionNode>
transformationContextRecord<string, any>
Returns

Maybe<SelectionNode | SelectionNode[]>

Defined in

packages/wrap/src/types.ts:54


FieldTransformer

Ƭ FieldTransformer<TContext>: (typeName: string, fieldName: string, fieldConfig: GraphQLFieldConfig<any, TContext>) => Maybe<GraphQLFieldConfig<any, TContext> | [string, GraphQLFieldConfig<any, TContext>]>

Type parameters

NameType
TContextRecord<string, any>

Type declaration

▸ (typeName, fieldName, fieldConfig): Maybe<GraphQLFieldConfig<any, TContext> | [string, GraphQLFieldConfig<any, TContext>]>

Parameters
NameType
typeNamestring
fieldNamestring
fieldConfigGraphQLFieldConfig<any, TContext>
Returns

Maybe<GraphQLFieldConfig<any, TContext> | [string, GraphQLFieldConfig<any, TContext>]>

Defined in

packages/wrap/src/types.ts:36


InputFieldNodeTransformer

Ƭ InputFieldNodeTransformer: <TContext>(typeName: string, fieldName: string, inputFieldNode: ObjectFieldNode, request: ExecutionRequest, delegationContext?: DelegationContext<TContext>) => ObjectFieldNode | ObjectFieldNode[]

Type declaration

▸ <TContext>(typeName, fieldName, inputFieldNode, request, delegationContext?): ObjectFieldNode | ObjectFieldNode[]

Type parameters
Name
TContext
Parameters
NameType
typeNamestring
fieldNamestring
inputFieldNodeObjectFieldNode
requestExecutionRequest
delegationContext?DelegationContext<TContext>
Returns

ObjectFieldNode | ObjectFieldNode[]

Defined in

packages/wrap/src/types.ts:21


InputFieldTransformer

Ƭ InputFieldTransformer: (typeName: string, fieldName: string, inputFieldConfig: GraphQLInputFieldConfig) => GraphQLInputFieldConfig | [string, GraphQLInputFieldConfig] | null | undefined

Type declaration

▸ (typeName, fieldName, inputFieldConfig): GraphQLInputFieldConfig | [string, GraphQLInputFieldConfig] | null | undefined

Parameters
NameType
typeNamestring
fieldNamestring
inputFieldConfigGraphQLInputFieldConfig
Returns

GraphQLInputFieldConfig | [string, GraphQLInputFieldConfig] | null | undefined

Defined in

packages/wrap/src/types.ts:15


InputObjectNodeTransformer

Ƭ InputObjectNodeTransformer: <TContext>(typeName: string, inputObjectNode: ObjectValueNode, request: ExecutionRequest, delegationContext?: DelegationContext<TContext>) => ObjectValueNode | undefined

Type declaration

▸ <TContext>(typeName, inputObjectNode, request, delegationContext?): ObjectValueNode | undefined

Type parameters
Name
TContext
Parameters
NameType
typeNamestring
inputObjectNodeObjectValueNode
requestExecutionRequest
delegationContext?DelegationContext<TContext>
Returns

ObjectValueNode | undefined

Defined in

packages/wrap/src/types.ts:29


LeafValueTransformer

Ƭ LeafValueTransformer: (typeName: string, value: any) => any

Type declaration

▸ (typeName, value): any

Parameters
NameType
typeNamestring
valueany
Returns

any

Defined in

packages/wrap/src/types.ts:62


ObjectValueTransformerMap

Ƭ ObjectValueTransformerMap: Record<string, DataTransformer>

Defined in

packages/wrap/src/types.ts:66


RootFieldTransformer

Ƭ RootFieldTransformer<TContext>: (operation: "Query" | "Mutation" | "Subscription", fieldName: string, fieldConfig: GraphQLFieldConfig<any, TContext>) => Maybe<GraphQLFieldConfig<any, TContext> | [string, GraphQLFieldConfig<any, TContext>]>

Type parameters

NameType
TContextRecord<string, any>

Type declaration

▸ (operation, fieldName, fieldConfig): Maybe<GraphQLFieldConfig<any, TContext> | [string, GraphQLFieldConfig<any, TContext>]>

Parameters
NameType
operation"Query" | "Mutation" | "Subscription"
fieldNamestring
fieldConfigGraphQLFieldConfig<any, TContext>
Returns

Maybe<GraphQLFieldConfig<any, TContext> | [string, GraphQLFieldConfig<any, TContext>]>

Defined in

packages/wrap/src/types.ts:42


SchemaFromExecutorOptions

Ƭ SchemaFromExecutorOptions: Partial<IntrospectionOptions> & Parameters<typeof buildClientSchema>[1] & ParseOptions

Defined in

packages/wrap/src/introspect.ts:46

Functions

defaultCreateProxyingResolver

defaultCreateProxyingResolver<TContext>(«destructured»): GraphQLFieldResolver<any, any>

Type parameters

NameType
TContextextends Record<string, any>

Parameters

NameType
«destructured»ICreateProxyingResolverOptions<TContext>

Returns

GraphQLFieldResolver<any, any>

Defined in

packages/wrap/src/generateProxyingResolvers.ts:89


generateProxyingResolvers

generateProxyingResolvers<TContext>(subschemaConfig): Record<string, Record<string, GraphQLFieldResolver<any, any>>>

Type parameters

NameType
TContextextends Record<string, any>

Parameters

NameType
subschemaConfigSubschemaConfig<any, any, any, TContext>

Returns

Record<string, Record<string, GraphQLFieldResolver<any, any>>>

Defined in

packages/wrap/src/generateProxyingResolvers.ts:13


schemaFromExecutor

schemaFromExecutor(executor, context?, options?): GraphQLSchema

Parameters

NameType
executorSyncExecutor
context?Record<string, any>
options?Partial<IntrospectionOptions> & GraphQLSchemaValidationOptions & ParseOptions

Returns

GraphQLSchema

Defined in

packages/wrap/src/introspect.ts:50

schemaFromExecutor(executor, context?, options?): Promise<GraphQLSchema>

Parameters

NameType
executorAsyncExecutor
context?Record<string, any>
options?Partial<IntrospectionOptions> & GraphQLSchemaValidationOptions & ParseOptions

Returns

Promise<GraphQLSchema>

Defined in

packages/wrap/src/introspect.ts:55

schemaFromExecutor(executor, context?, options?): MaybePromise<GraphQLSchema>

Parameters

NameType
executorExecutor
context?Record<string, any>
options?Partial<IntrospectionOptions> & GraphQLSchemaValidationOptions & ParseOptions

Returns

MaybePromise<GraphQLSchema>

Defined in

packages/wrap/src/introspect.ts:60


wrapSchema

wrapSchema<TConfig>(subschemaConfig): GraphQLSchema

Type parameters

NameType
TConfigextends Record<string, any> = Record<string, any>

Parameters

NameType
subschemaConfigSubschemaConfig<any, any, any, TConfig> | Subschema<any, any, any, TConfig>

Returns

GraphQLSchema

Defined in

packages/wrap/src/wrapSchema.ts:17