@graphql-tools/delegate 7.0.11-alpha-3e5e5d87.0 → 7.1.2
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 +12 -9
- package/es5/index.cjs.js.map +1 -1
- package/es5/index.d.ts +1 -0
- package/es5/index.esm.js +13 -10
- package/es5/index.esm.js.map +1 -1
- package/es5/package.json +5 -5
- package/es5/types.d.ts +28 -36
- package/getFieldsNotInSubschema.d.ts +1 -1
- package/index.cjs.js +6 -3
- package/index.cjs.js.map +1 -1
- package/index.d.ts +1 -0
- package/index.esm.js +6 -3
- package/index.esm.js.map +1 -1
- package/package.json +5 -5
- package/types.d.ts +28 -36
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,15 +236,18 @@ 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) {
|
|
243
|
-
newSubschemaConfig.merge[typeName] = tslib.__assign({}, subschemaConfig.merge[typeName]);
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
243
|
+
var mergedTypeConfig = (newSubschemaConfig.merge[typeName] = tslib.__assign({}, subschemaConfig.merge[typeName]));
|
|
244
|
+
if (mergedTypeConfig.entryPoints != null) {
|
|
245
|
+
mergedTypeConfig.entryPoints = mergedTypeConfig.entryPoints.map(function (entryPoint) { return (tslib.__assign({}, entryPoint)); });
|
|
246
|
+
}
|
|
247
|
+
if (mergedTypeConfig.fields != null) {
|
|
248
|
+
var fields_1 = (mergedTypeConfig.fields = tslib.__assign({}, mergedTypeConfig.fields));
|
|
249
|
+
Object.keys(fields_1).forEach(function (fieldName) {
|
|
250
|
+
fields_1[fieldName] = tslib.__assign({}, fields_1[fieldName]);
|
|
248
251
|
});
|
|
249
252
|
}
|
|
250
253
|
});
|
|
@@ -980,7 +983,7 @@ function expandAbstractTypes(targetSchema, possibleTypesMap, reversePossibleType
|
|
|
980
983
|
});
|
|
981
984
|
}
|
|
982
985
|
});
|
|
983
|
-
var newDocument = tslib.__assign(tslib.__assign({}, document), { definitions: tslib.
|
|
986
|
+
var newDocument = tslib.__assign(tslib.__assign({}, document), { definitions: tslib.__spreadArray(tslib.__spreadArray([], tslib.__read(operations)), tslib.__read(newFragments)) });
|
|
984
987
|
var typeInfo = new graphql.TypeInfo(targetSchema);
|
|
985
988
|
return graphql.visit(newDocument, graphql.visitWithTypeInfo(typeInfo, (_a = {},
|
|
986
989
|
_a[graphql.Kind.SELECTION_SET] = function (node) {
|
|
@@ -1223,7 +1226,7 @@ function filterToSchema(targetSchema, document, variables) {
|
|
|
1223
1226
|
return {
|
|
1224
1227
|
document: {
|
|
1225
1228
|
kind: graphql.Kind.DOCUMENT,
|
|
1226
|
-
definitions: tslib.
|
|
1229
|
+
definitions: tslib.__spreadArray(tslib.__spreadArray([], tslib.__read(newOperations)), tslib.__read(newFragments)),
|
|
1227
1230
|
},
|
|
1228
1231
|
variables: newVariables,
|
|
1229
1232
|
};
|
|
@@ -1515,7 +1518,7 @@ function addVariablesToRootField(targetSchema, originalRequest, args) {
|
|
|
1515
1518
|
} });
|
|
1516
1519
|
});
|
|
1517
1520
|
return {
|
|
1518
|
-
document: tslib.__assign(tslib.__assign({}, document), { definitions: tslib.
|
|
1521
|
+
document: tslib.__assign(tslib.__assign({}, document), { definitions: tslib.__spreadArray(tslib.__spreadArray([], tslib.__read(newOperations)), tslib.__read(fragments)) }),
|
|
1519
1522
|
variables: variableValues,
|
|
1520
1523
|
};
|
|
1521
1524
|
}
|