@graphql-mesh/runtime 1.0.0-alpha-20220804093904-8e2e41f7f → 1.0.0-alpha-20230420220344-25b6b92bf
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/constants.js +5 -0
- package/cjs/get-mesh.js +278 -0
- package/cjs/in-context-sdk.js +238 -0
- package/cjs/index.js +6 -0
- package/cjs/package.json +1 -0
- package/cjs/types.js +3 -0
- package/cjs/useSubschema.js +110 -0
- package/esm/constants.js +2 -0
- package/esm/get-mesh.js +273 -0
- package/esm/in-context-sdk.js +234 -0
- package/esm/index.js +3 -0
- package/esm/types.js +1 -0
- package/esm/useSubschema.js +106 -0
- package/package.json +33 -23
- package/typings/constants.d.ts +2 -0
- package/typings/get-mesh.d.cts +22 -0
- package/typings/get-mesh.d.ts +22 -0
- package/typings/in-context-sdk.d.cts +3 -0
- package/typings/in-context-sdk.d.ts +3 -0
- package/typings/index.d.cts +3 -0
- package/typings/index.d.ts +3 -0
- package/typings/types.d.cts +42 -0
- package/typings/types.d.ts +42 -0
- package/typings/useSubschema.d.cts +3 -0
- package/typings/useSubschema.d.ts +3 -0
- package/get-mesh.d.ts +0 -18
- package/in-context-sdk.d.ts +0 -3
- package/index.d.ts +0 -3
- package/index.js +0 -434
- package/index.mjs +0 -429
- package/types.d.ts +0 -42
- package/useSubschema.d.ts +0 -7
- /package/{constants.d.ts → typings/constants.d.cts} +0 -0
package/package.json
CHANGED
|
@@ -1,21 +1,24 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@graphql-mesh/runtime",
|
|
3
|
-
"version": "1.0.0-alpha-
|
|
3
|
+
"version": "1.0.0-alpha-20230420220344-25b6b92bf",
|
|
4
4
|
"sideEffects": false,
|
|
5
5
|
"peerDependencies": {
|
|
6
|
-
"@graphql-mesh/
|
|
7
|
-
"@graphql-mesh/
|
|
8
|
-
"graphql": "
|
|
6
|
+
"@graphql-mesh/cross-helpers": "^0.3.4",
|
|
7
|
+
"@graphql-mesh/types": "1.0.0-alpha-20230420220344-25b6b92bf",
|
|
8
|
+
"@graphql-mesh/utils": "1.0.0-alpha-20230420220344-25b6b92bf",
|
|
9
|
+
"@graphql-tools/utils": "^9.2.1",
|
|
10
|
+
"graphql": "*",
|
|
11
|
+
"tslib": "^2.4.0"
|
|
9
12
|
},
|
|
10
13
|
"dependencies": {
|
|
11
|
-
"@envelop/core": "
|
|
12
|
-
"@envelop/extended-validation": "
|
|
13
|
-
"@graphql-mesh/string-interpolation": "0.
|
|
14
|
-
"@graphql-tools/batch-delegate": "8.
|
|
15
|
-
"@graphql-tools/
|
|
16
|
-
"@graphql-tools/
|
|
17
|
-
"@graphql-tools/wrap": "
|
|
18
|
-
"
|
|
14
|
+
"@envelop/core": "3.0.6",
|
|
15
|
+
"@envelop/extended-validation": "2.0.6",
|
|
16
|
+
"@graphql-mesh/string-interpolation": "0.4.4",
|
|
17
|
+
"@graphql-tools/batch-delegate": "8.4.25",
|
|
18
|
+
"@graphql-tools/batch-execute": "8.5.19",
|
|
19
|
+
"@graphql-tools/delegate": "9.0.32",
|
|
20
|
+
"@graphql-tools/wrap": "9.4.2",
|
|
21
|
+
"@whatwg-node/fetch": "^0.8.3"
|
|
19
22
|
},
|
|
20
23
|
"repository": {
|
|
21
24
|
"type": "git",
|
|
@@ -23,21 +26,28 @@
|
|
|
23
26
|
"directory": "packages/runtime"
|
|
24
27
|
},
|
|
25
28
|
"license": "MIT",
|
|
26
|
-
"main": "index.js",
|
|
27
|
-
"module": "index.
|
|
28
|
-
"typings": "index.d.ts",
|
|
29
|
+
"main": "cjs/index.js",
|
|
30
|
+
"module": "esm/index.js",
|
|
31
|
+
"typings": "typings/index.d.ts",
|
|
29
32
|
"typescript": {
|
|
30
|
-
"definition": "index.d.ts"
|
|
33
|
+
"definition": "typings/index.d.ts"
|
|
31
34
|
},
|
|
35
|
+
"type": "module",
|
|
32
36
|
"exports": {
|
|
33
37
|
".": {
|
|
34
|
-
"require":
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
"
|
|
39
|
-
|
|
38
|
+
"require": {
|
|
39
|
+
"types": "./typings/index.d.cts",
|
|
40
|
+
"default": "./cjs/index.js"
|
|
41
|
+
},
|
|
42
|
+
"import": {
|
|
43
|
+
"types": "./typings/index.d.ts",
|
|
44
|
+
"default": "./esm/index.js"
|
|
45
|
+
},
|
|
46
|
+
"default": {
|
|
47
|
+
"types": "./typings/index.d.ts",
|
|
48
|
+
"default": "./esm/index.js"
|
|
49
|
+
}
|
|
40
50
|
},
|
|
41
51
|
"./package.json": "./package.json"
|
|
42
52
|
}
|
|
43
|
-
}
|
|
53
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { DocumentNode, GraphQLSchema } from 'graphql';
|
|
2
|
+
import { envelop, Plugin } from '@envelop/core';
|
|
3
|
+
import { KeyValueCache, Logger, MeshFetch, MeshPlugin, MeshPubSub, RawSourceOutput } from '@graphql-mesh/types';
|
|
4
|
+
import { ExecuteMeshFn, GetMeshOptions, MeshExecutor, SubscribeMeshFn } from './types.cjs';
|
|
5
|
+
type SdkRequester = (document: DocumentNode, variables?: any, operationContext?: any) => any;
|
|
6
|
+
export interface MeshInstance {
|
|
7
|
+
execute: ExecuteMeshFn;
|
|
8
|
+
subscribe: SubscribeMeshFn;
|
|
9
|
+
schema: GraphQLSchema;
|
|
10
|
+
createExecutor(globalContext: any): MeshExecutor;
|
|
11
|
+
rawSources: RawSourceOutput[];
|
|
12
|
+
destroy(): void;
|
|
13
|
+
pubsub: MeshPubSub;
|
|
14
|
+
cache: KeyValueCache;
|
|
15
|
+
logger: Logger;
|
|
16
|
+
plugins: Plugin[];
|
|
17
|
+
getEnveloped: ReturnType<typeof envelop>;
|
|
18
|
+
sdkRequesterFactory(globalContext: any): SdkRequester;
|
|
19
|
+
}
|
|
20
|
+
export declare function wrapFetchWithPlugins(plugins: MeshPlugin<any>[]): MeshFetch;
|
|
21
|
+
export declare function getMesh(options: GetMeshOptions): Promise<MeshInstance>;
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { DocumentNode, GraphQLSchema } from 'graphql';
|
|
2
|
+
import { envelop, Plugin } from '@envelop/core';
|
|
3
|
+
import { KeyValueCache, Logger, MeshFetch, MeshPlugin, MeshPubSub, RawSourceOutput } from '@graphql-mesh/types';
|
|
4
|
+
import { ExecuteMeshFn, GetMeshOptions, MeshExecutor, SubscribeMeshFn } from './types.js';
|
|
5
|
+
type SdkRequester = (document: DocumentNode, variables?: any, operationContext?: any) => any;
|
|
6
|
+
export interface MeshInstance {
|
|
7
|
+
execute: ExecuteMeshFn;
|
|
8
|
+
subscribe: SubscribeMeshFn;
|
|
9
|
+
schema: GraphQLSchema;
|
|
10
|
+
createExecutor(globalContext: any): MeshExecutor;
|
|
11
|
+
rawSources: RawSourceOutput[];
|
|
12
|
+
destroy(): void;
|
|
13
|
+
pubsub: MeshPubSub;
|
|
14
|
+
cache: KeyValueCache;
|
|
15
|
+
logger: Logger;
|
|
16
|
+
plugins: Plugin[];
|
|
17
|
+
getEnveloped: ReturnType<typeof envelop>;
|
|
18
|
+
sdkRequesterFactory(globalContext: any): SdkRequester;
|
|
19
|
+
}
|
|
20
|
+
export declare function wrapFetchWithPlugins(plugins: MeshPlugin<any>[]): MeshFetch;
|
|
21
|
+
export declare function getMesh(options: GetMeshOptions): Promise<MeshInstance>;
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { GraphQLSchema } from 'graphql';
|
|
2
|
+
import { Logger, OnDelegateHook, RawSourceOutput } from '@graphql-mesh/types';
|
|
3
|
+
export declare function getInContextSDK(unifiedSchema: GraphQLSchema, rawSources: RawSourceOutput[], logger: Logger, onDelegateHooks: OnDelegateHook<any>[]): Promise<Record<string, any>>;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { GraphQLSchema } from 'graphql';
|
|
2
|
+
import { Logger, OnDelegateHook, RawSourceOutput } from '@graphql-mesh/types';
|
|
3
|
+
export declare function getInContextSDK(unifiedSchema: GraphQLSchema, rawSources: RawSourceOutput[], logger: Logger, onDelegateHooks: OnDelegateHook<any>[]): Promise<Record<string, any>>;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { DocumentNode, ExecutionResult } from 'graphql';
|
|
2
|
+
import { envelop } from '@envelop/core';
|
|
3
|
+
import { GraphQLOperation, KeyValueCache, Logger, MeshFetch, MeshHandler, MeshMerger, MeshPubSub, MeshTransform, YamlConfig } from '@graphql-mesh/types';
|
|
4
|
+
import { IResolvers, Source } from '@graphql-tools/utils';
|
|
5
|
+
import { MESH_CONTEXT_SYMBOL } from './constants.cjs';
|
|
6
|
+
import { MeshInstance } from './get-mesh.cjs';
|
|
7
|
+
export type GetMeshOptions = {
|
|
8
|
+
sources: MeshResolvedSource[];
|
|
9
|
+
transforms?: MeshTransform[];
|
|
10
|
+
additionalTypeDefs?: DocumentNode[];
|
|
11
|
+
additionalResolvers?: IResolvers | IResolvers[];
|
|
12
|
+
cache: KeyValueCache;
|
|
13
|
+
pubsub?: MeshPubSub;
|
|
14
|
+
merger: MeshMerger;
|
|
15
|
+
logger?: Logger;
|
|
16
|
+
additionalEnvelopPlugins?: Parameters<typeof envelop>[0]['plugins'];
|
|
17
|
+
documents?: Source[];
|
|
18
|
+
fetchFn?: MeshFetch;
|
|
19
|
+
};
|
|
20
|
+
export type MeshResolvedSource = {
|
|
21
|
+
name: string;
|
|
22
|
+
handler: MeshHandler;
|
|
23
|
+
transforms?: MeshTransform[];
|
|
24
|
+
};
|
|
25
|
+
export type ExecuteMeshFn<TData = any, TVariables = any, TContext = any, TRootValue = any> = (document: GraphQLOperation<TData, TVariables>, variables: TVariables, context?: TContext, rootValue?: TRootValue, operationName?: string) => Promise<ExecutionResult<TData>>;
|
|
26
|
+
export type SubscribeMeshFn<TVariables = any, TContext = any, TRootValue = any, TData = any> = (document: GraphQLOperation<TData, TVariables>, variables?: TVariables, context?: TContext, rootValue?: TRootValue, operationName?: string) => Promise<ExecutionResult<TData> | AsyncIterable<ExecutionResult<TData>>>;
|
|
27
|
+
export type MeshContext = {
|
|
28
|
+
[MESH_CONTEXT_SYMBOL]: true;
|
|
29
|
+
} & {
|
|
30
|
+
pubsub: MeshPubSub;
|
|
31
|
+
cache: KeyValueCache;
|
|
32
|
+
logger: Logger;
|
|
33
|
+
};
|
|
34
|
+
export interface ServeMeshOptions {
|
|
35
|
+
baseDir: string;
|
|
36
|
+
getBuiltMesh: () => Promise<MeshInstance>;
|
|
37
|
+
logger: Logger;
|
|
38
|
+
rawServeConfig: YamlConfig.Config['serve'];
|
|
39
|
+
argsPort?: number;
|
|
40
|
+
playgroundTitle?: string;
|
|
41
|
+
}
|
|
42
|
+
export type MeshExecutor = <TData, TVariables, TContext, TRootValue>(documentOrSDL: GraphQLOperation<TData, TVariables>, variables?: TVariables, context?: TContext, rootValue?: TRootValue, operationName?: string) => Promise<TData | AsyncIterable<TData>>;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { DocumentNode, ExecutionResult } from 'graphql';
|
|
2
|
+
import { envelop } from '@envelop/core';
|
|
3
|
+
import { GraphQLOperation, KeyValueCache, Logger, MeshFetch, MeshHandler, MeshMerger, MeshPubSub, MeshTransform, YamlConfig } from '@graphql-mesh/types';
|
|
4
|
+
import { IResolvers, Source } from '@graphql-tools/utils';
|
|
5
|
+
import { MESH_CONTEXT_SYMBOL } from './constants.js';
|
|
6
|
+
import { MeshInstance } from './get-mesh.js';
|
|
7
|
+
export type GetMeshOptions = {
|
|
8
|
+
sources: MeshResolvedSource[];
|
|
9
|
+
transforms?: MeshTransform[];
|
|
10
|
+
additionalTypeDefs?: DocumentNode[];
|
|
11
|
+
additionalResolvers?: IResolvers | IResolvers[];
|
|
12
|
+
cache: KeyValueCache;
|
|
13
|
+
pubsub?: MeshPubSub;
|
|
14
|
+
merger: MeshMerger;
|
|
15
|
+
logger?: Logger;
|
|
16
|
+
additionalEnvelopPlugins?: Parameters<typeof envelop>[0]['plugins'];
|
|
17
|
+
documents?: Source[];
|
|
18
|
+
fetchFn?: MeshFetch;
|
|
19
|
+
};
|
|
20
|
+
export type MeshResolvedSource = {
|
|
21
|
+
name: string;
|
|
22
|
+
handler: MeshHandler;
|
|
23
|
+
transforms?: MeshTransform[];
|
|
24
|
+
};
|
|
25
|
+
export type ExecuteMeshFn<TData = any, TVariables = any, TContext = any, TRootValue = any> = (document: GraphQLOperation<TData, TVariables>, variables: TVariables, context?: TContext, rootValue?: TRootValue, operationName?: string) => Promise<ExecutionResult<TData>>;
|
|
26
|
+
export type SubscribeMeshFn<TVariables = any, TContext = any, TRootValue = any, TData = any> = (document: GraphQLOperation<TData, TVariables>, variables?: TVariables, context?: TContext, rootValue?: TRootValue, operationName?: string) => Promise<ExecutionResult<TData> | AsyncIterable<ExecutionResult<TData>>>;
|
|
27
|
+
export type MeshContext = {
|
|
28
|
+
[MESH_CONTEXT_SYMBOL]: true;
|
|
29
|
+
} & {
|
|
30
|
+
pubsub: MeshPubSub;
|
|
31
|
+
cache: KeyValueCache;
|
|
32
|
+
logger: Logger;
|
|
33
|
+
};
|
|
34
|
+
export interface ServeMeshOptions {
|
|
35
|
+
baseDir: string;
|
|
36
|
+
getBuiltMesh: () => Promise<MeshInstance>;
|
|
37
|
+
logger: Logger;
|
|
38
|
+
rawServeConfig: YamlConfig.Config['serve'];
|
|
39
|
+
argsPort?: number;
|
|
40
|
+
playgroundTitle?: string;
|
|
41
|
+
}
|
|
42
|
+
export type MeshExecutor = <TData, TVariables, TContext, TRootValue>(documentOrSDL: GraphQLOperation<TData, TVariables>, variables?: TVariables, context?: TContext, rootValue?: TRootValue, operationName?: string) => Promise<TData | AsyncIterable<TData>>;
|
package/get-mesh.d.ts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { GraphQLSchema, DocumentNode } from 'graphql';
|
|
2
|
-
import { ExecuteMeshFn, GetMeshOptions, SubscribeMeshFn } from './types';
|
|
3
|
-
import { MeshPubSub, KeyValueCache, RawSourceOutput, Logger } from '@graphql-mesh/types';
|
|
4
|
-
import { envelop, PluginOrDisabledPlugin } from '@envelop/core';
|
|
5
|
-
export interface MeshInstance {
|
|
6
|
-
execute: ExecuteMeshFn;
|
|
7
|
-
subscribe: SubscribeMeshFn;
|
|
8
|
-
schema: GraphQLSchema;
|
|
9
|
-
rawSources: RawSourceOutput[];
|
|
10
|
-
destroy(): void;
|
|
11
|
-
pubsub: MeshPubSub;
|
|
12
|
-
cache: KeyValueCache;
|
|
13
|
-
logger: Logger;
|
|
14
|
-
plugins: PluginOrDisabledPlugin[];
|
|
15
|
-
getEnveloped: ReturnType<typeof envelop>;
|
|
16
|
-
sdkRequesterFactory: (globalContext: any) => (document: DocumentNode, variables?: any, operationContext?: any) => any;
|
|
17
|
-
}
|
|
18
|
-
export declare function getMesh(options: GetMeshOptions): Promise<MeshInstance>;
|
package/in-context-sdk.d.ts
DELETED
package/index.d.ts
DELETED