@graphql-mesh/runtime
#
Type aliases- APIContext
- ExecuteMeshFn
- GetMeshOptions
- MeshContext
- MeshResolvedSource
- ProjectionOptions
- Requester
- SelectedFields
- SubscribeMeshFn
#
Functions#
Type aliases#
APIContextƬ APIContext: { api
: Record<string, (args
: any, projectionOptions
: ProjectionOptions) => Promise<any\>\> ; rawSource
: RawSourceOutput }
#
Type declaration:Name | Type |
---|---|
api | Record<string, (args : any, projectionOptions : ProjectionOptions) => Promise<any\>\> |
rawSource | RawSourceOutput |
Defined in: packages/runtime/src/types.ts:67
#
ExecuteMeshFnƬ ExecuteMeshFn<TData, TVariables\>: (document
: GraphQLOperation<TData, TVariables\>, variables
: TVariables) => Promise<TData | null | undefined\>
#
Type parameters:Name | Default |
---|---|
TData | any |
TVariables | any |
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:Name | Type |
---|---|
additionalResolvers? | IResolvers |
additionalTypeDefs? | DocumentNode[] |
cache | KeyValueCache |
ignoreAdditionalResolvers? | boolean |
merger | MergerFn |
pubsub | MeshPubSub |
sources | MeshResolvedSource[] |
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:Name | Default |
---|---|
TContext | any |
#
Type declaration:Name | Type |
---|---|
handler | MeshHandler<TContext\> |
name | string |
transforms? | MeshTransform[] |
Defined in: packages/runtime/src/types.ts:25
#
ProjectionOptionsƬ ProjectionOptions: { depth?
: number ; fields?
: SelectedFields ; selectionSet?
: string }
#
Type declaration:Name | Type | Description |
---|---|---|
depth? | number | If you don't provide custom selection, this is the depth of generated selection set by GraphQL Mesh default: 2 |
fields? | SelectedFields | Provide selection set in form of object similar to MongoDB's projection example: { foo: { bar: true }, baz: true } |
selectionSet? | string | Provide 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:Name | Default |
---|---|
C | any |
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:Name | Default |
---|---|
TData | any |
TVariables | any |
Defined in: packages/runtime/src/types.ts:36
#
Functions#
applyResolversHooksToResolversâ–¸ applyResolversHooksToResolvers(unifiedSchema
: GraphQLSchema, resolvers
: IResolvers, pubsub
: MeshPubSub): IResolvers
#
Parameters:Name | Type |
---|---|
unifiedSchema | GraphQLSchema |
resolvers | IResolvers |
pubsub | MeshPubSub |
Returns: IResolvers
Defined in: packages/runtime/src/resolvers-hooks.ts:98
#
applyResolversHooksToSchemaâ–¸ applyResolversHooksToSchema(schema
: GraphQLSchema, pubsub
: MeshPubSub): GraphQLSchema
#
Parameters:Name | Type |
---|---|
schema | GraphQLSchema |
pubsub | MeshPubSub |
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:Name | Type |
---|---|
options | GetMeshOptions |
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