@graphql-mesh/merger-stitching 1.0.0-alpha-20230523160518-5443a1139 → 1.0.0-alpha-20230524100919-8dfab7640
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/index.js +3 -4
- package/esm/index.js +3 -4
- package/package.json +12 -9
package/cjs/index.js
CHANGED
|
@@ -35,18 +35,17 @@ class StitchingMerger {
|
|
|
35
35
|
let newSchema = await this.store
|
|
36
36
|
.proxy(`${name}_stitching`, store_1.PredefinedProxyOptions.GraphQLSchemaWithDiffing)
|
|
37
37
|
.getWithSet(async () => {
|
|
38
|
-
var _a, _b, _c;
|
|
39
38
|
this.logger.debug(`Fetching Apollo Federated Service SDL for ${name}`);
|
|
40
39
|
let federationSdl;
|
|
41
|
-
if (
|
|
40
|
+
if (oldSchema.extensions?.directives?.link) {
|
|
42
41
|
federationSdl = (0, utils_2.printSchemaWithDirectives)(oldSchema);
|
|
43
42
|
}
|
|
44
43
|
else {
|
|
45
44
|
const sdlQueryResult = (await executor({
|
|
46
45
|
document: (0, graphql_1.parse)(APOLLO_GET_SERVICE_DEFINITION_QUERY),
|
|
47
46
|
}));
|
|
48
|
-
if (
|
|
49
|
-
throw new
|
|
47
|
+
if (sdlQueryResult.errors?.length) {
|
|
48
|
+
throw new AggregateError(sdlQueryResult.errors, `Failed on fetching Federated SDL for ${name}`);
|
|
50
49
|
}
|
|
51
50
|
federationSdl = sdlQueryResult.data._service.sdl;
|
|
52
51
|
}
|
package/esm/index.js
CHANGED
|
@@ -4,7 +4,7 @@ import { extractResolvers } from '@graphql-mesh/utils';
|
|
|
4
4
|
import { addResolversToSchema } from '@graphql-tools/schema';
|
|
5
5
|
import { stitchSchemas, ValidationLevel } from '@graphql-tools/stitch';
|
|
6
6
|
import { federationToStitchingSDL, stitchingDirectives, } from '@graphql-tools/stitching-directives';
|
|
7
|
-
import {
|
|
7
|
+
import { printSchemaWithDirectives } from '@graphql-tools/utils';
|
|
8
8
|
const APOLLO_GET_SERVICE_DEFINITION_QUERY = /* GraphQL */ `
|
|
9
9
|
query __ApolloGetServiceDefinition__ {
|
|
10
10
|
_service {
|
|
@@ -33,17 +33,16 @@ export default class StitchingMerger {
|
|
|
33
33
|
let newSchema = await this.store
|
|
34
34
|
.proxy(`${name}_stitching`, PredefinedProxyOptions.GraphQLSchemaWithDiffing)
|
|
35
35
|
.getWithSet(async () => {
|
|
36
|
-
var _a, _b, _c;
|
|
37
36
|
this.logger.debug(`Fetching Apollo Federated Service SDL for ${name}`);
|
|
38
37
|
let federationSdl;
|
|
39
|
-
if (
|
|
38
|
+
if (oldSchema.extensions?.directives?.link) {
|
|
40
39
|
federationSdl = printSchemaWithDirectives(oldSchema);
|
|
41
40
|
}
|
|
42
41
|
else {
|
|
43
42
|
const sdlQueryResult = (await executor({
|
|
44
43
|
document: parse(APOLLO_GET_SERVICE_DEFINITION_QUERY),
|
|
45
44
|
}));
|
|
46
|
-
if (
|
|
45
|
+
if (sdlQueryResult.errors?.length) {
|
|
47
46
|
throw new AggregateError(sdlQueryResult.errors, `Failed on fetching Federated SDL for ${name}`);
|
|
48
47
|
}
|
|
49
48
|
federationSdl = sdlQueryResult.data._service.sdl;
|
package/package.json
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@graphql-mesh/merger-stitching",
|
|
3
|
-
"version": "1.0.0-alpha-
|
|
3
|
+
"version": "1.0.0-alpha-20230524100919-8dfab7640",
|
|
4
4
|
"sideEffects": false,
|
|
5
5
|
"peerDependencies": {
|
|
6
|
-
"@graphql-mesh/store": "1.0.0-alpha-
|
|
7
|
-
"@graphql-mesh/types": "1.0.0-alpha-
|
|
8
|
-
"@graphql-mesh/utils": "1.0.0-alpha-
|
|
9
|
-
"@graphql-tools/utils": "^9.2.1",
|
|
6
|
+
"@graphql-mesh/store": "1.0.0-alpha-20230524100919-8dfab7640",
|
|
7
|
+
"@graphql-mesh/types": "1.0.0-alpha-20230524100919-8dfab7640",
|
|
8
|
+
"@graphql-mesh/utils": "1.0.0-alpha-20230524100919-8dfab7640",
|
|
9
|
+
"@graphql-tools/utils": "^9.2.1 || ^10.0.0",
|
|
10
10
|
"graphql": "*",
|
|
11
11
|
"tslib": "^2.4.0"
|
|
12
12
|
},
|
|
13
13
|
"dependencies": {
|
|
14
|
-
"@graphql-tools/delegate": "^
|
|
15
|
-
"@graphql-tools/schema": "^
|
|
16
|
-
"@graphql-tools/stitch": "^
|
|
17
|
-
"@graphql-tools/stitching-directives": "^
|
|
14
|
+
"@graphql-tools/delegate": "^10.0.0",
|
|
15
|
+
"@graphql-tools/schema": "^10.0.0",
|
|
16
|
+
"@graphql-tools/stitch": "^9.0.0",
|
|
17
|
+
"@graphql-tools/stitching-directives": "^3.0.0"
|
|
18
18
|
},
|
|
19
19
|
"repository": {
|
|
20
20
|
"type": "git",
|
|
@@ -22,6 +22,9 @@
|
|
|
22
22
|
"directory": "packages/mergers/stitching"
|
|
23
23
|
},
|
|
24
24
|
"license": "MIT",
|
|
25
|
+
"engines": {
|
|
26
|
+
"node": ">=16.0.0"
|
|
27
|
+
},
|
|
25
28
|
"main": "cjs/index.js",
|
|
26
29
|
"module": "esm/index.js",
|
|
27
30
|
"typings": "typings/index.d.ts",
|