@graphql-tools/delegate 7.0.11-alpha-2575037f.0 → 7.1.1
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/Subschema.d.ts +9 -8
- package/delegateToSchema.d.ts +2 -2
- package/es5/Subschema.d.ts +9 -8
- package/es5/delegateToSchema.d.ts +2 -2
- package/es5/getFieldsNotInSubschema.d.ts +1 -1
- package/es5/index.cjs.js +4 -4
- package/es5/index.cjs.js.map +1 -1
- package/es5/index.d.ts +1 -0
- package/es5/index.esm.js +5 -5
- package/es5/index.esm.js.map +1 -1
- package/es5/package.json +4 -4
- package/es5/types.d.ts +23 -34
- package/getFieldsNotInSubschema.d.ts +1 -1
- package/index.d.ts +1 -0
- package/package.json +4 -4
- package/types.d.ts +23 -34
package/Subschema.d.ts
CHANGED
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
import { GraphQLSchema } from 'graphql';
|
|
2
|
-
import { SubschemaConfig, Transform, MergedTypeConfig, CreateProxyingResolverFn,
|
|
2
|
+
import { SubschemaConfig, Transform, MergedTypeConfig, CreateProxyingResolverFn, BatchingOptions } from './types';
|
|
3
|
+
import { Executor, Subscriber } from '@graphql-tools/utils';
|
|
3
4
|
export declare function isSubschema(value: any): value is Subschema;
|
|
4
|
-
interface ISubschema extends SubschemaConfig {
|
|
5
|
+
interface ISubschema<K = any, V = any, C = K, TContext = Record<string, any>> extends SubschemaConfig<K, V, C, TContext> {
|
|
5
6
|
transformedSchema: GraphQLSchema;
|
|
6
7
|
}
|
|
7
|
-
export declare class Subschema<K = any, V = any, C = K
|
|
8
|
+
export declare class Subschema<K = any, V = any, C = K, TContext = Record<string, any>> implements ISubschema<K, V, C, TContext> {
|
|
8
9
|
schema: GraphQLSchema;
|
|
9
10
|
rootValue?: Record<string, any>;
|
|
10
|
-
executor?: Executor
|
|
11
|
-
subscriber?: Subscriber
|
|
11
|
+
executor?: Executor<TContext>;
|
|
12
|
+
subscriber?: Subscriber<TContext>;
|
|
12
13
|
batch?: boolean;
|
|
13
14
|
batchingOptions?: BatchingOptions<K, V, C>;
|
|
14
|
-
createProxyingResolver?: CreateProxyingResolverFn
|
|
15
|
+
createProxyingResolver?: CreateProxyingResolverFn<TContext>;
|
|
15
16
|
transforms: Array<Transform>;
|
|
16
17
|
transformedSchema: GraphQLSchema;
|
|
17
|
-
merge?: Record<string, MergedTypeConfig
|
|
18
|
-
constructor(config: SubschemaConfig);
|
|
18
|
+
merge?: Record<string, MergedTypeConfig<any, any, TContext>>;
|
|
19
|
+
constructor(config: SubschemaConfig<K, V, C, TContext>);
|
|
19
20
|
}
|
|
20
21
|
export {};
|
package/delegateToSchema.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { IDelegateToSchemaOptions, IDelegateRequestOptions } from './types';
|
|
2
|
-
export declare function delegateToSchema(options: IDelegateToSchemaOptions): any;
|
|
3
|
-
export declare function delegateRequest({ request, schema: subschemaOrSubschemaConfig, rootValue, info, operation, fieldName, args, returnType, onLocatedError, context, transforms, transformedSchema, skipValidation, skipTypeMerging, binding, }: IDelegateRequestOptions): any;
|
|
2
|
+
export declare function delegateToSchema<TContext = Record<string, any>, TArgs = any>(options: IDelegateToSchemaOptions<TContext, TArgs>): any;
|
|
3
|
+
export declare function delegateRequest<TContext = Record<string, any>, TArgs = any>({ request, schema: subschemaOrSubschemaConfig, rootValue, info, operation, fieldName, args, returnType, onLocatedError, context, transforms, transformedSchema, skipValidation, skipTypeMerging, binding, }: IDelegateRequestOptions<TContext, TArgs>): any;
|
package/es5/Subschema.d.ts
CHANGED
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
import { GraphQLSchema } from 'graphql';
|
|
2
|
-
import { SubschemaConfig, Transform, MergedTypeConfig, CreateProxyingResolverFn,
|
|
2
|
+
import { SubschemaConfig, Transform, MergedTypeConfig, CreateProxyingResolverFn, BatchingOptions } from './types';
|
|
3
|
+
import { Executor, Subscriber } from '@graphql-tools/utils';
|
|
3
4
|
export declare function isSubschema(value: any): value is Subschema;
|
|
4
|
-
interface ISubschema extends SubschemaConfig {
|
|
5
|
+
interface ISubschema<K = any, V = any, C = K, TContext = Record<string, any>> extends SubschemaConfig<K, V, C, TContext> {
|
|
5
6
|
transformedSchema: GraphQLSchema;
|
|
6
7
|
}
|
|
7
|
-
export declare class Subschema<K = any, V = any, C = K
|
|
8
|
+
export declare class Subschema<K = any, V = any, C = K, TContext = Record<string, any>> implements ISubschema<K, V, C, TContext> {
|
|
8
9
|
schema: GraphQLSchema;
|
|
9
10
|
rootValue?: Record<string, any>;
|
|
10
|
-
executor?: Executor
|
|
11
|
-
subscriber?: Subscriber
|
|
11
|
+
executor?: Executor<TContext>;
|
|
12
|
+
subscriber?: Subscriber<TContext>;
|
|
12
13
|
batch?: boolean;
|
|
13
14
|
batchingOptions?: BatchingOptions<K, V, C>;
|
|
14
|
-
createProxyingResolver?: CreateProxyingResolverFn
|
|
15
|
+
createProxyingResolver?: CreateProxyingResolverFn<TContext>;
|
|
15
16
|
transforms: Array<Transform>;
|
|
16
17
|
transformedSchema: GraphQLSchema;
|
|
17
|
-
merge?: Record<string, MergedTypeConfig
|
|
18
|
-
constructor(config: SubschemaConfig);
|
|
18
|
+
merge?: Record<string, MergedTypeConfig<any, any, TContext>>;
|
|
19
|
+
constructor(config: SubschemaConfig<K, V, C, TContext>);
|
|
19
20
|
}
|
|
20
21
|
export {};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { IDelegateToSchemaOptions, IDelegateRequestOptions } from './types';
|
|
2
|
-
export declare function delegateToSchema(options: IDelegateToSchemaOptions): any;
|
|
3
|
-
export declare function delegateRequest({ request, schema: subschemaOrSubschemaConfig, rootValue, info, operation, fieldName, args, returnType, onLocatedError, context, transforms, transformedSchema, skipValidation, skipTypeMerging, binding, }: IDelegateRequestOptions): any;
|
|
2
|
+
export declare function delegateToSchema<TContext = Record<string, any>, TArgs = any>(options: IDelegateToSchemaOptions<TContext, TArgs>): any;
|
|
3
|
+
export declare function delegateRequest<TContext = Record<string, any>, TArgs = any>({ request, schema: subschemaOrSubschemaConfig, rootValue, info, operation, fieldName, args, returnType, onLocatedError, context, transforms, transformedSchema, skipValidation, skipTypeMerging, binding, }: IDelegateRequestOptions<TContext, TArgs>): any;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { GraphQLSchema, FieldNode, GraphQLResolveInfo } from 'graphql';
|
|
2
2
|
import { MergedTypeInfo, SubschemaConfig } from './types';
|
|
3
|
-
export declare const getFieldsNotInSubschema: (A1: GraphQLResolveInfo, A2: GraphQLSchema | SubschemaConfig<any, any, any
|
|
3
|
+
export declare const getFieldsNotInSubschema: (A1: GraphQLResolveInfo, A2: GraphQLSchema | SubschemaConfig<any, any, any, Record<string, any>>, A3: MergedTypeInfo<Record<string, any>>) => FieldNode[];
|
package/es5/index.cjs.js
CHANGED
|
@@ -236,7 +236,7 @@ function isSubschemaConfig(value) {
|
|
|
236
236
|
return Boolean(value === null || value === void 0 ? void 0 : value.schema);
|
|
237
237
|
}
|
|
238
238
|
function cloneSubschemaConfig(subschemaConfig) {
|
|
239
|
-
var newSubschemaConfig = tslib.__assign(tslib.__assign({}, subschemaConfig), { transforms: subschemaConfig.transforms != null ? tslib.
|
|
239
|
+
var newSubschemaConfig = tslib.__assign(tslib.__assign({}, subschemaConfig), { transforms: subschemaConfig.transforms != null ? tslib.__spreadArray([], tslib.__read(subschemaConfig.transforms)) : undefined });
|
|
240
240
|
if (newSubschemaConfig.merge != null) {
|
|
241
241
|
newSubschemaConfig.merge = tslib.__assign({}, subschemaConfig.merge);
|
|
242
242
|
Object.keys(newSubschemaConfig.merge).forEach(function (typeName) {
|
|
@@ -980,7 +980,7 @@ function expandAbstractTypes(targetSchema, possibleTypesMap, reversePossibleType
|
|
|
980
980
|
});
|
|
981
981
|
}
|
|
982
982
|
});
|
|
983
|
-
var newDocument = tslib.__assign(tslib.__assign({}, document), { definitions: tslib.
|
|
983
|
+
var newDocument = tslib.__assign(tslib.__assign({}, document), { definitions: tslib.__spreadArray(tslib.__spreadArray([], tslib.__read(operations)), tslib.__read(newFragments)) });
|
|
984
984
|
var typeInfo = new graphql.TypeInfo(targetSchema);
|
|
985
985
|
return graphql.visit(newDocument, graphql.visitWithTypeInfo(typeInfo, (_a = {},
|
|
986
986
|
_a[graphql.Kind.SELECTION_SET] = function (node) {
|
|
@@ -1223,7 +1223,7 @@ function filterToSchema(targetSchema, document, variables) {
|
|
|
1223
1223
|
return {
|
|
1224
1224
|
document: {
|
|
1225
1225
|
kind: graphql.Kind.DOCUMENT,
|
|
1226
|
-
definitions: tslib.
|
|
1226
|
+
definitions: tslib.__spreadArray(tslib.__spreadArray([], tslib.__read(newOperations)), tslib.__read(newFragments)),
|
|
1227
1227
|
},
|
|
1228
1228
|
variables: newVariables,
|
|
1229
1229
|
};
|
|
@@ -1515,7 +1515,7 @@ function addVariablesToRootField(targetSchema, originalRequest, args) {
|
|
|
1515
1515
|
} });
|
|
1516
1516
|
});
|
|
1517
1517
|
return {
|
|
1518
|
-
document: tslib.__assign(tslib.__assign({}, document), { definitions: tslib.
|
|
1518
|
+
document: tslib.__assign(tslib.__assign({}, document), { definitions: tslib.__spreadArray(tslib.__spreadArray([], tslib.__read(newOperations)), tslib.__read(fragments)) }),
|
|
1519
1519
|
variables: variableValues,
|
|
1520
1520
|
};
|
|
1521
1521
|
}
|