@graphql-tools/stitch 10.2.5 → 10.2.6-alpha-8f117bcbea98536ce3233d8bc38febf5e9a2ebe5
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/CHANGELOG.md +16 -0
- package/dist/index.cjs +28 -20
- package/dist/index.js +29 -21
- package/package.json +8 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @graphql-tools/stitch
|
|
2
2
|
|
|
3
|
+
## 10.2.6-alpha-8f117bcbea98536ce3233d8bc38febf5e9a2ebe5
|
|
4
|
+
### Patch Changes
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
- [#2604](https://github.com/graphql-hive/gateway/pull/2604) [`19e4040`](https://github.com/graphql-hive/gateway/commit/19e404065a9d88215d1530749b43ce5e39262a56) Thanks [@enisdenjo](https://github.com/enisdenjo)! - dependencies updates:
|
|
9
|
+
|
|
10
|
+
- Updated dependency [`@graphql-tools/executor@^2.0.1` ↗︎](https://www.npmjs.com/package/@graphql-tools/executor/v/2.0.1) (from `^1.4.13`, in `dependencies`)
|
|
11
|
+
- Updated dependency [`@graphql-tools/merge@^9.2.4` ↗︎](https://www.npmjs.com/package/@graphql-tools/merge/v/9.2.4) (from `^9.1.5`, in `dependencies`)
|
|
12
|
+
- Updated dependency [`@graphql-tools/schema@^10.1.1` ↗︎](https://www.npmjs.com/package/@graphql-tools/schema/v/10.1.1) (from `^10.0.29`, in `dependencies`)
|
|
13
|
+
- Updated dependency [`@graphql-tools/utils@^12.0.1` ↗︎](https://www.npmjs.com/package/@graphql-tools/utils/v/12.0.1) (from `^11.0.0`, in `dependencies`)
|
|
14
|
+
- Updated dependencies [[`19e4040`](https://github.com/graphql-hive/gateway/commit/19e404065a9d88215d1530749b43ce5e39262a56), [`19e4040`](https://github.com/graphql-hive/gateway/commit/19e404065a9d88215d1530749b43ce5e39262a56), [`19e4040`](https://github.com/graphql-hive/gateway/commit/19e404065a9d88215d1530749b43ce5e39262a56)]:
|
|
15
|
+
- @graphql-tools/batch-delegate@10.0.33-alpha-8f117bcbea98536ce3233d8bc38febf5e9a2ebe5
|
|
16
|
+
- @graphql-tools/delegate@12.1.5-alpha-8f117bcbea98536ce3233d8bc38febf5e9a2ebe5
|
|
17
|
+
- @graphql-tools/wrap@11.1.25-alpha-8f117bcbea98536ce3233d8bc38febf5e9a2ebe5
|
|
18
|
+
|
|
3
19
|
## 10.2.5
|
|
4
20
|
### Patch Changes
|
|
5
21
|
|
package/dist/index.cjs
CHANGED
|
@@ -189,10 +189,11 @@ function resolveOne(value, context, info, stitchingInfo, providedFields) {
|
|
|
189
189
|
|
|
190
190
|
function getFieldsNotInSubschema(schema, stitchingInfo, gatewayType, subschemaType, fieldNodes, fragments, variableValues, subschema, providedSelectionNode, context, info) {
|
|
191
191
|
const sourceSchema = subschema.transformedSchema;
|
|
192
|
+
const normalizedVariableValues = delegate.getVariableValues(variableValues);
|
|
192
193
|
let { fields: subFieldNodesByResponseKey } = utils.collectSubFields(
|
|
193
194
|
schema,
|
|
194
195
|
fragments,
|
|
195
|
-
|
|
196
|
+
normalizedVariableValues,
|
|
196
197
|
gatewayType,
|
|
197
198
|
fieldNodes
|
|
198
199
|
);
|
|
@@ -210,7 +211,7 @@ function getFieldsNotInSubschema(schema, stitchingInfo, gatewayType, subschemaTy
|
|
|
210
211
|
const { fields: subFieldNodesOfPossibleType } = utils.collectSubFields(
|
|
211
212
|
schema,
|
|
212
213
|
fragments,
|
|
213
|
-
|
|
214
|
+
normalizedVariableValues,
|
|
214
215
|
possibleType,
|
|
215
216
|
fieldNodes
|
|
216
217
|
);
|
|
@@ -1315,7 +1316,7 @@ function completeStitchingInfo(stitchingInfo, resolvers, schema) {
|
|
|
1315
1316
|
}
|
|
1316
1317
|
}
|
|
1317
1318
|
}
|
|
1318
|
-
const variableValues =
|
|
1319
|
+
const variableValues = delegate.getVariableValues(void 0);
|
|
1319
1320
|
const fragments = /* @__PURE__ */ Object.create(null);
|
|
1320
1321
|
const fieldNodeMap = /* @__PURE__ */ Object.create(null);
|
|
1321
1322
|
for (const typeName in selectionSetsByField) {
|
|
@@ -1397,6 +1398,7 @@ function isolateComputedFieldsTransformer(subschemaConfig) {
|
|
|
1397
1398
|
}
|
|
1398
1399
|
const baseSchemaTypes = /* @__PURE__ */ Object.create(null);
|
|
1399
1400
|
const isolatedSchemaTypes = /* @__PURE__ */ Object.create(null);
|
|
1401
|
+
const variableValues = delegate.getVariableValues(void 0);
|
|
1400
1402
|
for (const typeName in subschemaConfig.merge) {
|
|
1401
1403
|
const mergedTypeConfig = subschemaConfig.merge[typeName];
|
|
1402
1404
|
const objectType = subschemaConfig.schema.getType(
|
|
@@ -1434,7 +1436,7 @@ function isolateComputedFieldsTransformer(subschemaConfig) {
|
|
|
1434
1436
|
const keyFields = utils.collectFields(
|
|
1435
1437
|
subschemaConfig.schema,
|
|
1436
1438
|
{},
|
|
1437
|
-
|
|
1439
|
+
variableValues,
|
|
1438
1440
|
objectType,
|
|
1439
1441
|
parsedSelectionSet
|
|
1440
1442
|
);
|
|
@@ -1449,7 +1451,7 @@ function isolateComputedFieldsTransformer(subschemaConfig) {
|
|
|
1449
1451
|
const keyFields = utils.collectFields(
|
|
1450
1452
|
subschemaConfig.schema,
|
|
1451
1453
|
{},
|
|
1452
|
-
|
|
1454
|
+
variableValues,
|
|
1453
1455
|
objectType,
|
|
1454
1456
|
parsedSelectionSet
|
|
1455
1457
|
);
|
|
@@ -1506,7 +1508,7 @@ function isolateComputedFieldsTransformer(subschemaConfig) {
|
|
|
1506
1508
|
const keyFields = utils.collectFields(
|
|
1507
1509
|
subschemaConfig.schema,
|
|
1508
1510
|
{},
|
|
1509
|
-
|
|
1511
|
+
variableValues,
|
|
1510
1512
|
type,
|
|
1511
1513
|
parsedSelectionSet
|
|
1512
1514
|
);
|
|
@@ -1520,7 +1522,7 @@ function isolateComputedFieldsTransformer(subschemaConfig) {
|
|
|
1520
1522
|
const keyFields2 = utils.collectFields(
|
|
1521
1523
|
subschemaConfig.schema,
|
|
1522
1524
|
{},
|
|
1523
|
-
|
|
1525
|
+
variableValues,
|
|
1524
1526
|
type,
|
|
1525
1527
|
parsedSelectionSet2
|
|
1526
1528
|
);
|
|
@@ -3607,7 +3609,7 @@ function createStitchingExecutor(stitchedSchema) {
|
|
|
3607
3609
|
const { fields } = utils.collectFields(
|
|
3608
3610
|
stitchedSchema,
|
|
3609
3611
|
fragments,
|
|
3610
|
-
executorRequest.variables,
|
|
3612
|
+
delegate.getVariableValues(executorRequest.variables),
|
|
3611
3613
|
rootType,
|
|
3612
3614
|
operation.selectionSet
|
|
3613
3615
|
);
|
|
@@ -3635,23 +3637,29 @@ function createStitchingExecutor(stitchedSchema) {
|
|
|
3635
3637
|
fieldNode,
|
|
3636
3638
|
executorRequest.variables
|
|
3637
3639
|
);
|
|
3640
|
+
const info = {
|
|
3641
|
+
schema: stitchedSchema,
|
|
3642
|
+
fieldName,
|
|
3643
|
+
fieldNodes,
|
|
3644
|
+
operation,
|
|
3645
|
+
fragments,
|
|
3646
|
+
parentType: rootType,
|
|
3647
|
+
returnType: fieldInstance.type,
|
|
3648
|
+
variableValues: executorRequest.variables,
|
|
3649
|
+
rootValue: executorRequest.rootValue,
|
|
3650
|
+
path: { typename: void 0, key: responseKey, prev: void 0 },
|
|
3651
|
+
getAbortSignal: () => executorRequest.signal,
|
|
3652
|
+
getAsyncHelpers: () => ({
|
|
3653
|
+
promiseAll: Promise.all.bind(Promise),
|
|
3654
|
+
track: () => void 0
|
|
3655
|
+
})
|
|
3656
|
+
};
|
|
3638
3657
|
let result = await delegate.delegateToSchema({
|
|
3639
3658
|
schema: subschemaForField || stitchedSchema,
|
|
3640
3659
|
rootValue: executorRequest.rootValue,
|
|
3641
3660
|
args,
|
|
3642
3661
|
context: executorRequest.context,
|
|
3643
|
-
info
|
|
3644
|
-
schema: stitchedSchema,
|
|
3645
|
-
fieldName,
|
|
3646
|
-
fieldNodes,
|
|
3647
|
-
operation,
|
|
3648
|
-
fragments,
|
|
3649
|
-
parentType: rootType,
|
|
3650
|
-
returnType: fieldInstance.type,
|
|
3651
|
-
variableValues: executorRequest.variables,
|
|
3652
|
-
rootValue: executorRequest.rootValue,
|
|
3653
|
-
path: { typename: void 0, key: responseKey, prev: void 0 }
|
|
3654
|
-
}
|
|
3662
|
+
info
|
|
3655
3663
|
});
|
|
3656
3664
|
if (Array.isArray(result)) {
|
|
3657
3665
|
result = await Promise.all(result);
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { isExternalObject, handleOverrideByDelegation, subtractSelectionSets, extractUnavailableFields, leftOverByDelegationPlan, extractUnavailableFieldsFromSelectionSet, delegateToSchema, cloneSubschemaConfig, isSubschemaConfig, defaultMergedResolver, Subschema } from '@graphql-tools/delegate';
|
|
1
|
+
import { isExternalObject, getVariableValues, handleOverrideByDelegation, subtractSelectionSets, extractUnavailableFields, leftOverByDelegationPlan, extractUnavailableFieldsFromSelectionSet, delegateToSchema, cloneSubschemaConfig, isSubschemaConfig, defaultMergedResolver, Subschema } from '@graphql-tools/delegate';
|
|
2
2
|
import { mergeType, mergeInputType, mergeInterface, mergeUnion, mergeEnum, mergeScalar, mergeTypeDefs, mergeResolvers, mergeExtensions, applyExtensions } from '@graphql-tools/merge';
|
|
3
3
|
import { extendResolversFromInterfaces, addResolversToSchema, assertResolversPresent, makeExecutableSchema } from '@graphql-tools/schema';
|
|
4
4
|
import { mergeDeep, collectSubFields, memoize3, memoize2, memoize1, parseSelectionSet, collectFields, isSome, getImplementingTypes, getRootTypeNames, filterSchema, getDescription, createNamedStub, createStub, getRootTypeMap, getRootTypes, inspect, rewireTypes, getOperationASTFromRequest, getDefinedRootType, getArgumentValues } from '@graphql-tools/utils';
|
|
@@ -187,10 +187,11 @@ function resolveOne(value, context, info, stitchingInfo, providedFields) {
|
|
|
187
187
|
|
|
188
188
|
function getFieldsNotInSubschema(schema, stitchingInfo, gatewayType, subschemaType, fieldNodes, fragments, variableValues, subschema, providedSelectionNode, context, info) {
|
|
189
189
|
const sourceSchema = subschema.transformedSchema;
|
|
190
|
+
const normalizedVariableValues = getVariableValues(variableValues);
|
|
190
191
|
let { fields: subFieldNodesByResponseKey } = collectSubFields(
|
|
191
192
|
schema,
|
|
192
193
|
fragments,
|
|
193
|
-
|
|
194
|
+
normalizedVariableValues,
|
|
194
195
|
gatewayType,
|
|
195
196
|
fieldNodes
|
|
196
197
|
);
|
|
@@ -208,7 +209,7 @@ function getFieldsNotInSubschema(schema, stitchingInfo, gatewayType, subschemaTy
|
|
|
208
209
|
const { fields: subFieldNodesOfPossibleType } = collectSubFields(
|
|
209
210
|
schema,
|
|
210
211
|
fragments,
|
|
211
|
-
|
|
212
|
+
normalizedVariableValues,
|
|
212
213
|
possibleType,
|
|
213
214
|
fieldNodes
|
|
214
215
|
);
|
|
@@ -1313,7 +1314,7 @@ function completeStitchingInfo(stitchingInfo, resolvers, schema) {
|
|
|
1313
1314
|
}
|
|
1314
1315
|
}
|
|
1315
1316
|
}
|
|
1316
|
-
const variableValues =
|
|
1317
|
+
const variableValues = getVariableValues(void 0);
|
|
1317
1318
|
const fragments = /* @__PURE__ */ Object.create(null);
|
|
1318
1319
|
const fieldNodeMap = /* @__PURE__ */ Object.create(null);
|
|
1319
1320
|
for (const typeName in selectionSetsByField) {
|
|
@@ -1395,6 +1396,7 @@ function isolateComputedFieldsTransformer(subschemaConfig) {
|
|
|
1395
1396
|
}
|
|
1396
1397
|
const baseSchemaTypes = /* @__PURE__ */ Object.create(null);
|
|
1397
1398
|
const isolatedSchemaTypes = /* @__PURE__ */ Object.create(null);
|
|
1399
|
+
const variableValues = getVariableValues(void 0);
|
|
1398
1400
|
for (const typeName in subschemaConfig.merge) {
|
|
1399
1401
|
const mergedTypeConfig = subschemaConfig.merge[typeName];
|
|
1400
1402
|
const objectType = subschemaConfig.schema.getType(
|
|
@@ -1432,7 +1434,7 @@ function isolateComputedFieldsTransformer(subschemaConfig) {
|
|
|
1432
1434
|
const keyFields = collectFields(
|
|
1433
1435
|
subschemaConfig.schema,
|
|
1434
1436
|
{},
|
|
1435
|
-
|
|
1437
|
+
variableValues,
|
|
1436
1438
|
objectType,
|
|
1437
1439
|
parsedSelectionSet
|
|
1438
1440
|
);
|
|
@@ -1447,7 +1449,7 @@ function isolateComputedFieldsTransformer(subschemaConfig) {
|
|
|
1447
1449
|
const keyFields = collectFields(
|
|
1448
1450
|
subschemaConfig.schema,
|
|
1449
1451
|
{},
|
|
1450
|
-
|
|
1452
|
+
variableValues,
|
|
1451
1453
|
objectType,
|
|
1452
1454
|
parsedSelectionSet
|
|
1453
1455
|
);
|
|
@@ -1504,7 +1506,7 @@ function isolateComputedFieldsTransformer(subschemaConfig) {
|
|
|
1504
1506
|
const keyFields = collectFields(
|
|
1505
1507
|
subschemaConfig.schema,
|
|
1506
1508
|
{},
|
|
1507
|
-
|
|
1509
|
+
variableValues,
|
|
1508
1510
|
type,
|
|
1509
1511
|
parsedSelectionSet
|
|
1510
1512
|
);
|
|
@@ -1518,7 +1520,7 @@ function isolateComputedFieldsTransformer(subschemaConfig) {
|
|
|
1518
1520
|
const keyFields2 = collectFields(
|
|
1519
1521
|
subschemaConfig.schema,
|
|
1520
1522
|
{},
|
|
1521
|
-
|
|
1523
|
+
variableValues,
|
|
1522
1524
|
type,
|
|
1523
1525
|
parsedSelectionSet2
|
|
1524
1526
|
);
|
|
@@ -3605,7 +3607,7 @@ function createStitchingExecutor(stitchedSchema) {
|
|
|
3605
3607
|
const { fields } = collectFields(
|
|
3606
3608
|
stitchedSchema,
|
|
3607
3609
|
fragments,
|
|
3608
|
-
executorRequest.variables,
|
|
3610
|
+
getVariableValues(executorRequest.variables),
|
|
3609
3611
|
rootType,
|
|
3610
3612
|
operation.selectionSet
|
|
3611
3613
|
);
|
|
@@ -3633,23 +3635,29 @@ function createStitchingExecutor(stitchedSchema) {
|
|
|
3633
3635
|
fieldNode,
|
|
3634
3636
|
executorRequest.variables
|
|
3635
3637
|
);
|
|
3638
|
+
const info = {
|
|
3639
|
+
schema: stitchedSchema,
|
|
3640
|
+
fieldName,
|
|
3641
|
+
fieldNodes,
|
|
3642
|
+
operation,
|
|
3643
|
+
fragments,
|
|
3644
|
+
parentType: rootType,
|
|
3645
|
+
returnType: fieldInstance.type,
|
|
3646
|
+
variableValues: executorRequest.variables,
|
|
3647
|
+
rootValue: executorRequest.rootValue,
|
|
3648
|
+
path: { typename: void 0, key: responseKey, prev: void 0 },
|
|
3649
|
+
getAbortSignal: () => executorRequest.signal,
|
|
3650
|
+
getAsyncHelpers: () => ({
|
|
3651
|
+
promiseAll: Promise.all.bind(Promise),
|
|
3652
|
+
track: () => void 0
|
|
3653
|
+
})
|
|
3654
|
+
};
|
|
3636
3655
|
let result = await delegateToSchema({
|
|
3637
3656
|
schema: subschemaForField || stitchedSchema,
|
|
3638
3657
|
rootValue: executorRequest.rootValue,
|
|
3639
3658
|
args,
|
|
3640
3659
|
context: executorRequest.context,
|
|
3641
|
-
info
|
|
3642
|
-
schema: stitchedSchema,
|
|
3643
|
-
fieldName,
|
|
3644
|
-
fieldNodes,
|
|
3645
|
-
operation,
|
|
3646
|
-
fragments,
|
|
3647
|
-
parentType: rootType,
|
|
3648
|
-
returnType: fieldInstance.type,
|
|
3649
|
-
variableValues: executorRequest.variables,
|
|
3650
|
-
rootValue: executorRequest.rootValue,
|
|
3651
|
-
path: { typename: void 0, key: responseKey, prev: void 0 }
|
|
3652
|
-
}
|
|
3660
|
+
info
|
|
3653
3661
|
});
|
|
3654
3662
|
if (Array.isArray(result)) {
|
|
3655
3663
|
result = await Promise.all(result);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@graphql-tools/stitch",
|
|
3
|
-
"version": "10.2.
|
|
3
|
+
"version": "10.2.6-alpha-8f117bcbea98536ce3233d8bc38febf5e9a2ebe5",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A set of utils for faster development of GraphQL tools",
|
|
6
6
|
"repository": {
|
|
@@ -38,13 +38,13 @@
|
|
|
38
38
|
"graphql": "^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@graphql-tools/batch-delegate": "
|
|
42
|
-
"@graphql-tools/delegate": "
|
|
43
|
-
"@graphql-tools/executor": "^
|
|
44
|
-
"@graphql-tools/merge": "^9.
|
|
45
|
-
"@graphql-tools/schema": "^10.
|
|
46
|
-
"@graphql-tools/utils": "^
|
|
47
|
-
"@graphql-tools/wrap": "
|
|
41
|
+
"@graphql-tools/batch-delegate": "10.0.33-alpha-8f117bcbea98536ce3233d8bc38febf5e9a2ebe5",
|
|
42
|
+
"@graphql-tools/delegate": "12.1.5-alpha-8f117bcbea98536ce3233d8bc38febf5e9a2ebe5",
|
|
43
|
+
"@graphql-tools/executor": "^2.0.1",
|
|
44
|
+
"@graphql-tools/merge": "^9.2.4",
|
|
45
|
+
"@graphql-tools/schema": "^10.1.1",
|
|
46
|
+
"@graphql-tools/utils": "^12.0.1",
|
|
47
|
+
"@graphql-tools/wrap": "11.1.25-alpha-8f117bcbea98536ce3233d8bc38febf5e9a2ebe5",
|
|
48
48
|
"@whatwg-node/promise-helpers": "^1.3.2",
|
|
49
49
|
"tslib": "^2.8.1"
|
|
50
50
|
},
|