@graphql-mesh/runtime

Type aliases#

Functions#

Type aliases#

APIContext#

Ƭ APIContext: { api: Record<string, (args: any, projectionOptions: ProjectionOptions) => Promise<any\>\> ; rawSource: RawSourceOutput }

Type declaration:#

NameType
apiRecord<string, (args: any, projectionOptions: ProjectionOptions) => Promise<any\>\>
rawSourceRawSourceOutput

Defined in: packages/runtime/src/types.ts:67


ExecuteMeshFn#

Ƭ ExecuteMeshFn<TData, TVariables\>: (document: GraphQLOperation<TData, TVariables\>, variables: TVariables) => Promise<TData | null | undefined\>

Type parameters:#

NameDefault
TDataany
TVariablesany

Defined in: packages/runtime/src/types.ts:31


GetMeshOptions#

Ƭ GetMeshOptions: { additionalResolvers?: IResolvers ; additionalTypeDefs?: DocumentNode[] ; cache: KeyValueCache ; ignoreAdditionalResolvers?: boolean ; merger: MergerFn ; pubsub: MeshPubSub ; sources: MeshResolvedSource[] ; transforms?: MeshTransform[] }

Type declaration:#

NameType
additionalResolvers?IResolvers
additionalTypeDefs?DocumentNode[]
cacheKeyValueCache
ignoreAdditionalResolvers?boolean
mergerMergerFn
pubsubMeshPubSub
sourcesMeshResolvedSource[]
transforms?MeshTransform[]

Defined in: packages/runtime/src/types.ts:14


MeshContext#

Ƭ MeshContext: { [key: string]: APIContext; __@MESH_CONTEXT_SYMBOL@1949: true } & { cache: KeyValueCache ; pubsub: MeshPubSub }

Defined in: packages/runtime/src/types.ts:72


MeshResolvedSource#

Ƭ MeshResolvedSource<TContext\>: { handler: MeshHandler<TContext\> ; name: string ; transforms?: MeshTransform[] }

Type parameters:#

NameDefault
TContextany

Type declaration:#

NameType
handlerMeshHandler<TContext\>
namestring
transforms?MeshTransform[]

Defined in: packages/runtime/src/types.ts:25


ProjectionOptions#

Ƭ ProjectionOptions: { depth?: number ; fields?: SelectedFields ; selectionSet?: string }

Type declaration:#

NameTypeDescription
depth?numberIf you don't provide custom selection, this is the depth of generated selection set by GraphQL Mesh default: 2
fields?SelectedFieldsProvide selection set in form of object similar to MongoDB's projection example: { foo: { bar: true }, baz: true }
selectionSet?stringProvide selection set in form of GraphQL SDL example: { foo bar baz }

Defined in: packages/runtime/src/types.ts:49


Requester#

Ƭ Requester<C\>: <R, V\>(doc: DocumentNode, vars?: V, options?: C) => Promise<R\>

Type parameters:#

NameDefault
Cany

Defined in: packages/runtime/src/types.ts:41


SelectedFields#

Ƭ SelectedFields: { [fieldName: string]: SelectedFields; } | true

Defined in: packages/runtime/src/types.ts:43


SubscribeMeshFn#

Ƭ SubscribeMeshFn<TData, TVariables\>: (document: GraphQLOperation<TData, TVariables\>, variables: TVariables) => Promise<TData | null | undefined | AsyncIterableIterator<TData | null | undefined\>\>

Type parameters:#

NameDefault
TDataany
TVariablesany

Defined in: packages/runtime/src/types.ts:36

Functions#

applyResolversHooksToResolvers#

applyResolversHooksToResolvers(unifiedSchema: GraphQLSchema, resolvers: IResolvers, pubsub: MeshPubSub): IResolvers

Parameters:#

NameType
unifiedSchemaGraphQLSchema
resolversIResolvers
pubsubMeshPubSub

Returns: IResolvers

Defined in: packages/runtime/src/resolvers-hooks.ts:98


applyResolversHooksToSchema#

applyResolversHooksToSchema(schema: GraphQLSchema, pubsub: MeshPubSub): GraphQLSchema

Parameters:#

NameType
schemaGraphQLSchema
pubsubMeshPubSub

Returns: GraphQLSchema

Defined in: packages/runtime/src/resolvers-hooks.ts:240


getMesh#

getMesh(options: GetMeshOptions): Promise<{ cache: KeyValueCache ; contextBuilder: (initialContextValue?: any) => Promise<Record<string, any\>\> ; destroy: () => void ; execute: ExecuteMeshFn ; pubsub: MeshPubSub ; rawSources: RawSourceOutput[] ; schema: GraphQLSchema ; sdkRequester: Requester ; subscribe: SubscribeMeshFn }\>

Parameters:#

NameType
optionsGetMeshOptions

Returns: Promise<{ cache: KeyValueCache ; contextBuilder: (initialContextValue?: any) => Promise<Record<string, any\>\> ; destroy: () => void ; execute: ExecuteMeshFn ; pubsub: MeshPubSub ; rawSources: RawSourceOutput[] ; schema: GraphQLSchema ; sdkRequester: Requester ; subscribe: SubscribeMeshFn }\>

Defined in: packages/runtime/src/get-mesh.ts:10