Skip to main content

@graphql-mesh/runtime

Type aliases#

Functions#

Type aliases#

APIContext#

Ƭ APIContext: object

Type declaration:#

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

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


ExecuteMeshFn#

Ƭ ExecuteMeshFn<TData, TVariables, TContext, TRootValue\>: (document: GraphQLOperation<TData, TVariables\>, variables: TVariables, context?: TContext, rootValue?: TRootValue, operationName?: string) => Promise<TData | null | undefined\>

Type parameters:#

NameDefault
TDataany
TVariablesany
TContextany
TRootValueany

Type declaration:#

▸ (document: GraphQLOperation<TData, TVariables\>, variables: TVariables, context?: TContext, rootValue?: TRootValue, operationName?: string): Promise<TData | null | undefined\>

Parameters:#

NameType
documentGraphQLOperation<TData, TVariables\>
variablesTVariables
context?TContext
rootValue?TRootValue
operationName?string

Returns: Promise<TData | null | undefined\>

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


GetMeshOptions#

Ƭ GetMeshOptions: object

Type declaration:#

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

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


MeshContext#

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

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


MeshResolvedSource#

Ƭ MeshResolvedSource<TContext\>: object

Type parameters:#

NameDefault
TContextany

Type declaration:#

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

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


ProjectionOptions#

Ƭ ProjectionOptions: object

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:57


Requester#

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

Type parameters:#

NameDefault
Cany

Type declaration:#

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

Type parameters:#

Name
R
V

Parameters:#

NameType
docDocumentNode
vars?V
options?C

Returns: Promise<R\>

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


SelectedFields#

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

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


SubscribeMeshFn#

Ƭ SubscribeMeshFn<TVariables, TContext, TRootValue, TData\>: (document: GraphQLOperation<TData, TVariables\>, variables?: TVariables, context?: TContext, rootValue?: TRootValue, operationName?: string) => Promise<TData | null | undefined | AsyncIterableIterator<TData | null | undefined\>\>

Type parameters:#

NameDefault
TVariablesany
TContextany
TRootValueany
TDataany

Type declaration:#

▸ (document: GraphQLOperation<TData, TVariables\>, variables?: TVariables, context?: TContext, rootValue?: TRootValue, operationName?: string): Promise<TData | null | undefined | AsyncIterableIterator<TData | null | undefined\>\>

Parameters:#

NameType
documentGraphQLOperation<TData, TVariables\>
variables?TVariables
context?TContext
rootValue?TRootValue
operationName?string

Returns: Promise<TData | null | undefined | AsyncIterableIterator<TData | null | undefined\>\>

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

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 ; liveQueryStore: InMemoryLiveQueryStore ; 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 ; liveQueryStore: InMemoryLiveQueryStore ; pubsub: MeshPubSub ; rawSources: RawSourceOutput[] ; schema: GraphQLSchema ; sdkRequester: Requester ; subscribe: SubscribeMeshFn }\>

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