@graphql-mesh/compose-cli 1.4.16 → 1.4.17-alpha-20250905102756-036568e64f83b360f631264a630ed9ce6b261da0
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.
|
@@ -41,6 +41,22 @@ const utils_2 = require("@graphql-tools/utils");
|
|
|
41
41
|
const promise_helpers_1 = require("@whatwg-node/promise-helpers");
|
|
42
42
|
function fixExtends(node) {
|
|
43
43
|
return (0, graphql_1.visit)(node, {
|
|
44
|
+
[graphql_1.Kind.DIRECTIVE](node) {
|
|
45
|
+
if (node.name.value === 'link') {
|
|
46
|
+
const url = node.arguments?.find(arg => arg.name.value === 'url')?.value;
|
|
47
|
+
if (url?.kind === graphql_1.Kind.STRING &&
|
|
48
|
+
url.value.startsWith('https://specs.apollo.dev/federation/v2.')) {
|
|
49
|
+
const imports = node.arguments?.find(arg => arg.name.value === 'import')?.value;
|
|
50
|
+
if (imports?.kind === graphql_1.Kind.LIST) {
|
|
51
|
+
// @ts-expect-error - We can modify it
|
|
52
|
+
imports.values.push({
|
|
53
|
+
kind: graphql_1.Kind.STRING,
|
|
54
|
+
value: '@extends',
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
},
|
|
44
60
|
[graphql_1.Kind.OBJECT_TYPE_EXTENSION](node) {
|
|
45
61
|
return {
|
|
46
62
|
...node,
|
|
@@ -5,6 +5,22 @@ import { createGraphQLError, isValidPath, } from '@graphql-tools/utils';
|
|
|
5
5
|
import { handleMaybePromise } from '@whatwg-node/promise-helpers';
|
|
6
6
|
function fixExtends(node) {
|
|
7
7
|
return visit(node, {
|
|
8
|
+
[Kind.DIRECTIVE](node) {
|
|
9
|
+
if (node.name.value === 'link') {
|
|
10
|
+
const url = node.arguments?.find(arg => arg.name.value === 'url')?.value;
|
|
11
|
+
if (url?.kind === Kind.STRING &&
|
|
12
|
+
url.value.startsWith('https://specs.apollo.dev/federation/v2.')) {
|
|
13
|
+
const imports = node.arguments?.find(arg => arg.name.value === 'import')?.value;
|
|
14
|
+
if (imports?.kind === Kind.LIST) {
|
|
15
|
+
// @ts-expect-error - We can modify it
|
|
16
|
+
imports.values.push({
|
|
17
|
+
kind: Kind.STRING,
|
|
18
|
+
value: '@extends',
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
},
|
|
8
24
|
[Kind.OBJECT_TYPE_EXTENSION](node) {
|
|
9
25
|
return {
|
|
10
26
|
...node,
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@graphql-mesh/compose-cli",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.17-alpha-20250905102756-036568e64f83b360f631264a630ed9ce6b261da0",
|
|
4
4
|
"sideEffects": false,
|
|
5
5
|
"peerDependencies": {
|
|
6
6
|
"graphql": "*"
|
|
7
7
|
},
|
|
8
8
|
"dependencies": {
|
|
9
9
|
"@commander-js/extra-typings": "^14.0.0",
|
|
10
|
-
"@graphql-mesh/fusion-composition": "
|
|
10
|
+
"@graphql-mesh/fusion-composition": "0.8.16-alpha-20250905102756-036568e64f83b360f631264a630ed9ce6b261da0",
|
|
11
11
|
"@graphql-mesh/include": "^0.3.11",
|
|
12
12
|
"@graphql-mesh/string-interpolation": "^0.5.8",
|
|
13
13
|
"@graphql-mesh/types": "^0.104.11",
|