@depup/graphql-codegen__plugin-helpers 6.2.0-depup.1 → 7.1.0-depup.8
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/LICENSE +21 -0
- package/README.md +5 -6
- package/changes.json +6 -10
- package/cjs/federation.js +20 -8
- package/cjs/helpers.js +12 -6
- package/cjs/utils.js +5 -1
- package/esm/federation.js +20 -8
- package/esm/helpers.js +12 -6
- package/esm/utils.js +6 -2
- package/package.json +10 -15
- package/typings/federation.d.cts +4 -2
- package/typings/federation.d.ts +4 -2
- package/typings/oldVisit.d.cts +2 -9
- package/typings/oldVisit.d.ts +2 -9
- package/typings/types.d.cts +19 -2
- package/typings/types.d.ts +19 -2
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2016 Dotan Simha
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -13,18 +13,17 @@ npm install @depup/graphql-codegen__plugin-helpers
|
|
|
13
13
|
|
|
14
14
|
| Field | Value |
|
|
15
15
|
|-------|-------|
|
|
16
|
-
| Original | [@graphql-codegen/plugin-helpers](https://www.npmjs.com/package/@graphql-codegen/plugin-helpers) @
|
|
17
|
-
| Processed | 2026-
|
|
16
|
+
| Original | [@graphql-codegen/plugin-helpers](https://www.npmjs.com/package/@graphql-codegen/plugin-helpers) @ 7.1.0 |
|
|
17
|
+
| Processed | 2026-07-21 |
|
|
18
18
|
| Smoke test | passed |
|
|
19
|
-
| Deps updated |
|
|
19
|
+
| Deps updated | 2 |
|
|
20
20
|
|
|
21
21
|
## Dependency Changes
|
|
22
22
|
|
|
23
23
|
| Dependency | From | To |
|
|
24
24
|
|------------|------|-----|
|
|
25
|
-
|
|
|
26
|
-
|
|
|
27
|
-
| tslib | ~2.6.0 | ^2.8.1 |
|
|
25
|
+
| @graphql-tools/utils | ^11.2.0 | ^11.2.2 |
|
|
26
|
+
| tslib | ^2.8.0 | ^2.8.1 |
|
|
28
27
|
|
|
29
28
|
---
|
|
30
29
|
|
package/changes.json
CHANGED
|
@@ -1,18 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"bumped": {
|
|
3
|
-
"
|
|
4
|
-
"from": "
|
|
5
|
-
"to": "^2.
|
|
6
|
-
},
|
|
7
|
-
"lodash": {
|
|
8
|
-
"from": "~4.17.0",
|
|
9
|
-
"to": "^4.18.0"
|
|
3
|
+
"@graphql-tools/utils": {
|
|
4
|
+
"from": "^11.2.0",
|
|
5
|
+
"to": "^11.2.2"
|
|
10
6
|
},
|
|
11
7
|
"tslib": {
|
|
12
|
-
"from": "
|
|
8
|
+
"from": "^2.8.0",
|
|
13
9
|
"to": "^2.8.1"
|
|
14
10
|
}
|
|
15
11
|
},
|
|
16
|
-
"timestamp": "2026-
|
|
17
|
-
"totalUpdated":
|
|
12
|
+
"timestamp": "2026-07-21T16:05:24.059Z",
|
|
13
|
+
"totalUpdated": 2
|
|
18
14
|
}
|
package/cjs/federation.js
CHANGED
|
@@ -3,8 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.ApolloFederation = exports.federationSpec = void 0;
|
|
4
4
|
exports.addFederationReferencesToSchema = addFederationReferencesToSchema;
|
|
5
5
|
exports.removeFederation = removeFederation;
|
|
6
|
-
const utils_1 = require("@graphql-tools/utils");
|
|
7
6
|
const graphql_1 = require("graphql");
|
|
7
|
+
const utils_1 = require("@graphql-tools/utils");
|
|
8
8
|
const index_js_1 = require("./index.js");
|
|
9
9
|
const utils_js_1 = require("./utils.js");
|
|
10
10
|
/**
|
|
@@ -25,7 +25,7 @@ exports.federationSpec = (0, graphql_1.parse)(/* GraphQL */ `
|
|
|
25
25
|
* - return type
|
|
26
26
|
* @param schema
|
|
27
27
|
*/
|
|
28
|
-
function addFederationReferencesToSchema(schema) {
|
|
28
|
+
function addFederationReferencesToSchema(schema, config) {
|
|
29
29
|
const setFederationMeta = ({ meta, typeName, update, }) => {
|
|
30
30
|
meta[typeName] = {
|
|
31
31
|
...(meta[typeName] ||
|
|
@@ -43,7 +43,10 @@ function addFederationReferencesToSchema(schema) {
|
|
|
43
43
|
// @key() @key() - "primary keys" in Federation
|
|
44
44
|
// A reference may receive one primary key combination at a time, so they will be combined with `|`
|
|
45
45
|
const primaryKeys = resolvableKeyDirectives.map(extractReferenceSelectionSet);
|
|
46
|
-
referenceSelectionSets.push({
|
|
46
|
+
referenceSelectionSets.push({
|
|
47
|
+
directive: '@key',
|
|
48
|
+
selectionSets: [...primaryKeys],
|
|
49
|
+
});
|
|
47
50
|
const requiresPossibleTypes = [];
|
|
48
51
|
for (const fieldNode of Object.values(fields)) {
|
|
49
52
|
// Look for @requires and see what the service needs and gets
|
|
@@ -53,7 +56,10 @@ function addFederationReferencesToSchema(schema) {
|
|
|
53
56
|
requiresPossibleTypes.push(requires);
|
|
54
57
|
}
|
|
55
58
|
}
|
|
56
|
-
referenceSelectionSets.push({
|
|
59
|
+
referenceSelectionSets.push({
|
|
60
|
+
directive: '@requires',
|
|
61
|
+
selectionSets: requiresPossibleTypes,
|
|
62
|
+
});
|
|
57
63
|
return referenceSelectionSets;
|
|
58
64
|
};
|
|
59
65
|
/**
|
|
@@ -149,6 +155,8 @@ function addFederationReferencesToSchema(schema) {
|
|
|
149
155
|
typeConfig.fields = {
|
|
150
156
|
[resolveReferenceFieldName]: {
|
|
151
157
|
type,
|
|
158
|
+
args: {},
|
|
159
|
+
extensions: {},
|
|
152
160
|
},
|
|
153
161
|
...typeConfig.fields,
|
|
154
162
|
};
|
|
@@ -158,7 +166,7 @@ function addFederationReferencesToSchema(schema) {
|
|
|
158
166
|
});
|
|
159
167
|
const referenceSelectionSetsString = printReferenceSelectionSets({
|
|
160
168
|
typeName: type.name,
|
|
161
|
-
baseFederationType:
|
|
169
|
+
baseFederationType: `${config.convertName('FederationTypes')}['${type.name}']`,
|
|
162
170
|
referenceSelectionSets,
|
|
163
171
|
});
|
|
164
172
|
setFederationMeta({
|
|
@@ -187,12 +195,14 @@ function addFederationReferencesToSchema(schema) {
|
|
|
187
195
|
typeConfig.fields = {
|
|
188
196
|
[resolveReferenceFieldName]: {
|
|
189
197
|
type,
|
|
198
|
+
args: {},
|
|
199
|
+
extensions: {},
|
|
190
200
|
},
|
|
191
201
|
...typeConfig.fields,
|
|
192
202
|
};
|
|
193
203
|
const referenceSelectionSetsString = printReferenceSelectionSets({
|
|
194
204
|
typeName: type.name,
|
|
195
|
-
baseFederationType:
|
|
205
|
+
baseFederationType: `${config.convertName('FederationTypes')}['${type.name}']`,
|
|
196
206
|
referenceSelectionSets,
|
|
197
207
|
});
|
|
198
208
|
setFederationMeta({
|
|
@@ -254,7 +264,7 @@ class ApolloFederation {
|
|
|
254
264
|
*/
|
|
255
265
|
fieldsToGenerate;
|
|
256
266
|
meta = {};
|
|
257
|
-
constructor({ enabled, schema, meta }) {
|
|
267
|
+
constructor({ enabled, schema, meta, }) {
|
|
258
268
|
this.enabled = enabled;
|
|
259
269
|
this.schema = schema;
|
|
260
270
|
this.providesMap = this.createMapOfProvides();
|
|
@@ -395,7 +405,9 @@ function checkTypeFederationDetails(node, schema) {
|
|
|
395
405
|
}
|
|
396
406
|
const resolvableKeyDirectives = keyDirectives.filter(d => {
|
|
397
407
|
for (const arg of d.arguments) {
|
|
398
|
-
if (arg.name.value === 'resolvable' &&
|
|
408
|
+
if (arg.name.value === 'resolvable' &&
|
|
409
|
+
arg.value.kind === 'BooleanValue' &&
|
|
410
|
+
arg.value.value === false) {
|
|
399
411
|
return false;
|
|
400
412
|
}
|
|
401
413
|
}
|
package/cjs/helpers.js
CHANGED
|
@@ -68,10 +68,10 @@ function isUsingTypes(document, externalFragments, schema) {
|
|
|
68
68
|
enter(node, key, parent, anscestors) {
|
|
69
69
|
const insideIgnoredFragment = anscestors.find((f) => f.kind && f.kind === 'FragmentDefinition' && externalFragments.includes(f.name.value));
|
|
70
70
|
if (insideIgnoredFragment) {
|
|
71
|
-
return;
|
|
71
|
+
return node;
|
|
72
72
|
}
|
|
73
73
|
const selections = node.selections || [];
|
|
74
|
-
if (schema && selections.length > 0) {
|
|
74
|
+
if (schema && selections.length > 0 && !Array.isArray(parent) && 'kind' in parent) {
|
|
75
75
|
const nextTypeName = (() => {
|
|
76
76
|
if (parent.kind === graphql_1.Kind.FRAGMENT_DEFINITION) {
|
|
77
77
|
return parent.typeCondition.name.value;
|
|
@@ -107,23 +107,26 @@ function isUsingTypes(document, externalFragments, schema) {
|
|
|
107
107
|
return null;
|
|
108
108
|
})();
|
|
109
109
|
typesStack.push(schema.getType(nextTypeName));
|
|
110
|
+
return node;
|
|
110
111
|
}
|
|
112
|
+
return undefined;
|
|
111
113
|
},
|
|
112
114
|
leave(node) {
|
|
113
115
|
const selections = node.selections || [];
|
|
114
116
|
if (schema && selections.length > 0) {
|
|
115
117
|
typesStack.pop();
|
|
116
118
|
}
|
|
119
|
+
return node;
|
|
117
120
|
},
|
|
118
121
|
},
|
|
119
122
|
Field: {
|
|
120
123
|
enter: (node, key, parent, path, anscestors) => {
|
|
121
124
|
if (node.name.value.startsWith('__')) {
|
|
122
|
-
return;
|
|
125
|
+
return node;
|
|
123
126
|
}
|
|
124
127
|
const insideIgnoredFragment = anscestors.find((f) => f.kind && f.kind === 'FragmentDefinition' && externalFragments.includes(f.name.value));
|
|
125
128
|
if (insideIgnoredFragment) {
|
|
126
|
-
return;
|
|
129
|
+
return node;
|
|
127
130
|
}
|
|
128
131
|
const selections = node.selectionSet ? node.selectionSet.selections || [] : [];
|
|
129
132
|
const relevantFragmentSpreads = selections.filter(s => s.kind === graphql_1.Kind.FRAGMENT_SPREAD && !externalFragments.includes(s.name.value));
|
|
@@ -144,24 +147,27 @@ function isUsingTypes(document, externalFragments, schema) {
|
|
|
144
147
|
}
|
|
145
148
|
}
|
|
146
149
|
}
|
|
150
|
+
return undefined;
|
|
147
151
|
},
|
|
148
152
|
},
|
|
149
153
|
VariableDefinition: {
|
|
150
154
|
enter: (node, key, parent, path, anscestors) => {
|
|
151
155
|
const insideIgnoredFragment = anscestors.find((f) => f.kind && f.kind === 'FragmentDefinition' && externalFragments.includes(f.name.value));
|
|
152
156
|
if (insideIgnoredFragment) {
|
|
153
|
-
return;
|
|
157
|
+
return node;
|
|
154
158
|
}
|
|
155
159
|
foundFields++;
|
|
160
|
+
return undefined;
|
|
156
161
|
},
|
|
157
162
|
},
|
|
158
163
|
InputValueDefinition: {
|
|
159
164
|
enter: (node, key, parent, path, anscestors) => {
|
|
160
165
|
const insideIgnoredFragment = anscestors.find((f) => f.kind && f.kind === 'FragmentDefinition' && externalFragments.includes(f.name.value));
|
|
161
166
|
if (insideIgnoredFragment) {
|
|
162
|
-
return;
|
|
167
|
+
return node;
|
|
163
168
|
}
|
|
164
169
|
foundFields++;
|
|
170
|
+
return node;
|
|
165
171
|
},
|
|
166
172
|
},
|
|
167
173
|
});
|
package/cjs/utils.js
CHANGED
|
@@ -6,7 +6,11 @@ exports.getBaseType = getBaseType;
|
|
|
6
6
|
exports.removeNonNullWrapper = removeNonNullWrapper;
|
|
7
7
|
const graphql_1 = require("graphql");
|
|
8
8
|
function mergeOutputs(content) {
|
|
9
|
-
const result = {
|
|
9
|
+
const result = {
|
|
10
|
+
content: '',
|
|
11
|
+
prepend: [],
|
|
12
|
+
append: [],
|
|
13
|
+
};
|
|
10
14
|
if (Array.isArray(content)) {
|
|
11
15
|
for (const item of content) {
|
|
12
16
|
if (typeof item === 'string') {
|
package/esm/federation.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { astFromInterfaceType, astFromObjectType, getRootTypeNames, MapperKind, mapSchema } from '@graphql-tools/utils';
|
|
2
1
|
import { GraphQLInterfaceType, GraphQLObjectType, isObjectType, parse, } from 'graphql';
|
|
2
|
+
import { astFromInterfaceType, astFromObjectType, getRootTypeNames, MapperKind, mapSchema, } from '@graphql-tools/utils';
|
|
3
3
|
import { oldVisit } from './index.js';
|
|
4
4
|
import { getBaseType } from './utils.js';
|
|
5
5
|
/**
|
|
@@ -20,7 +20,7 @@ export const federationSpec = parse(/* GraphQL */ `
|
|
|
20
20
|
* - return type
|
|
21
21
|
* @param schema
|
|
22
22
|
*/
|
|
23
|
-
export function addFederationReferencesToSchema(schema) {
|
|
23
|
+
export function addFederationReferencesToSchema(schema, config) {
|
|
24
24
|
const setFederationMeta = ({ meta, typeName, update, }) => {
|
|
25
25
|
meta[typeName] = {
|
|
26
26
|
...(meta[typeName] ||
|
|
@@ -38,7 +38,10 @@ export function addFederationReferencesToSchema(schema) {
|
|
|
38
38
|
// @key() @key() - "primary keys" in Federation
|
|
39
39
|
// A reference may receive one primary key combination at a time, so they will be combined with `|`
|
|
40
40
|
const primaryKeys = resolvableKeyDirectives.map(extractReferenceSelectionSet);
|
|
41
|
-
referenceSelectionSets.push({
|
|
41
|
+
referenceSelectionSets.push({
|
|
42
|
+
directive: '@key',
|
|
43
|
+
selectionSets: [...primaryKeys],
|
|
44
|
+
});
|
|
42
45
|
const requiresPossibleTypes = [];
|
|
43
46
|
for (const fieldNode of Object.values(fields)) {
|
|
44
47
|
// Look for @requires and see what the service needs and gets
|
|
@@ -48,7 +51,10 @@ export function addFederationReferencesToSchema(schema) {
|
|
|
48
51
|
requiresPossibleTypes.push(requires);
|
|
49
52
|
}
|
|
50
53
|
}
|
|
51
|
-
referenceSelectionSets.push({
|
|
54
|
+
referenceSelectionSets.push({
|
|
55
|
+
directive: '@requires',
|
|
56
|
+
selectionSets: requiresPossibleTypes,
|
|
57
|
+
});
|
|
52
58
|
return referenceSelectionSets;
|
|
53
59
|
};
|
|
54
60
|
/**
|
|
@@ -144,6 +150,8 @@ export function addFederationReferencesToSchema(schema) {
|
|
|
144
150
|
typeConfig.fields = {
|
|
145
151
|
[resolveReferenceFieldName]: {
|
|
146
152
|
type,
|
|
153
|
+
args: {},
|
|
154
|
+
extensions: {},
|
|
147
155
|
},
|
|
148
156
|
...typeConfig.fields,
|
|
149
157
|
};
|
|
@@ -153,7 +161,7 @@ export function addFederationReferencesToSchema(schema) {
|
|
|
153
161
|
});
|
|
154
162
|
const referenceSelectionSetsString = printReferenceSelectionSets({
|
|
155
163
|
typeName: type.name,
|
|
156
|
-
baseFederationType:
|
|
164
|
+
baseFederationType: `${config.convertName('FederationTypes')}['${type.name}']`,
|
|
157
165
|
referenceSelectionSets,
|
|
158
166
|
});
|
|
159
167
|
setFederationMeta({
|
|
@@ -182,12 +190,14 @@ export function addFederationReferencesToSchema(schema) {
|
|
|
182
190
|
typeConfig.fields = {
|
|
183
191
|
[resolveReferenceFieldName]: {
|
|
184
192
|
type,
|
|
193
|
+
args: {},
|
|
194
|
+
extensions: {},
|
|
185
195
|
},
|
|
186
196
|
...typeConfig.fields,
|
|
187
197
|
};
|
|
188
198
|
const referenceSelectionSetsString = printReferenceSelectionSets({
|
|
189
199
|
typeName: type.name,
|
|
190
|
-
baseFederationType:
|
|
200
|
+
baseFederationType: `${config.convertName('FederationTypes')}['${type.name}']`,
|
|
191
201
|
referenceSelectionSets,
|
|
192
202
|
});
|
|
193
203
|
setFederationMeta({
|
|
@@ -249,7 +259,7 @@ export class ApolloFederation {
|
|
|
249
259
|
*/
|
|
250
260
|
fieldsToGenerate;
|
|
251
261
|
meta = {};
|
|
252
|
-
constructor({ enabled, schema, meta }) {
|
|
262
|
+
constructor({ enabled, schema, meta, }) {
|
|
253
263
|
this.enabled = enabled;
|
|
254
264
|
this.schema = schema;
|
|
255
265
|
this.providesMap = this.createMapOfProvides();
|
|
@@ -389,7 +399,9 @@ function checkTypeFederationDetails(node, schema) {
|
|
|
389
399
|
}
|
|
390
400
|
const resolvableKeyDirectives = keyDirectives.filter(d => {
|
|
391
401
|
for (const arg of d.arguments) {
|
|
392
|
-
if (arg.name.value === 'resolvable' &&
|
|
402
|
+
if (arg.name.value === 'resolvable' &&
|
|
403
|
+
arg.value.kind === 'BooleanValue' &&
|
|
404
|
+
arg.value.value === false) {
|
|
393
405
|
return false;
|
|
394
406
|
}
|
|
395
407
|
}
|
package/esm/helpers.js
CHANGED
|
@@ -58,10 +58,10 @@ export function isUsingTypes(document, externalFragments, schema) {
|
|
|
58
58
|
enter(node, key, parent, anscestors) {
|
|
59
59
|
const insideIgnoredFragment = anscestors.find((f) => f.kind && f.kind === 'FragmentDefinition' && externalFragments.includes(f.name.value));
|
|
60
60
|
if (insideIgnoredFragment) {
|
|
61
|
-
return;
|
|
61
|
+
return node;
|
|
62
62
|
}
|
|
63
63
|
const selections = node.selections || [];
|
|
64
|
-
if (schema && selections.length > 0) {
|
|
64
|
+
if (schema && selections.length > 0 && !Array.isArray(parent) && 'kind' in parent) {
|
|
65
65
|
const nextTypeName = (() => {
|
|
66
66
|
if (parent.kind === Kind.FRAGMENT_DEFINITION) {
|
|
67
67
|
return parent.typeCondition.name.value;
|
|
@@ -97,23 +97,26 @@ export function isUsingTypes(document, externalFragments, schema) {
|
|
|
97
97
|
return null;
|
|
98
98
|
})();
|
|
99
99
|
typesStack.push(schema.getType(nextTypeName));
|
|
100
|
+
return node;
|
|
100
101
|
}
|
|
102
|
+
return undefined;
|
|
101
103
|
},
|
|
102
104
|
leave(node) {
|
|
103
105
|
const selections = node.selections || [];
|
|
104
106
|
if (schema && selections.length > 0) {
|
|
105
107
|
typesStack.pop();
|
|
106
108
|
}
|
|
109
|
+
return node;
|
|
107
110
|
},
|
|
108
111
|
},
|
|
109
112
|
Field: {
|
|
110
113
|
enter: (node, key, parent, path, anscestors) => {
|
|
111
114
|
if (node.name.value.startsWith('__')) {
|
|
112
|
-
return;
|
|
115
|
+
return node;
|
|
113
116
|
}
|
|
114
117
|
const insideIgnoredFragment = anscestors.find((f) => f.kind && f.kind === 'FragmentDefinition' && externalFragments.includes(f.name.value));
|
|
115
118
|
if (insideIgnoredFragment) {
|
|
116
|
-
return;
|
|
119
|
+
return node;
|
|
117
120
|
}
|
|
118
121
|
const selections = node.selectionSet ? node.selectionSet.selections || [] : [];
|
|
119
122
|
const relevantFragmentSpreads = selections.filter(s => s.kind === Kind.FRAGMENT_SPREAD && !externalFragments.includes(s.name.value));
|
|
@@ -134,24 +137,27 @@ export function isUsingTypes(document, externalFragments, schema) {
|
|
|
134
137
|
}
|
|
135
138
|
}
|
|
136
139
|
}
|
|
140
|
+
return undefined;
|
|
137
141
|
},
|
|
138
142
|
},
|
|
139
143
|
VariableDefinition: {
|
|
140
144
|
enter: (node, key, parent, path, anscestors) => {
|
|
141
145
|
const insideIgnoredFragment = anscestors.find((f) => f.kind && f.kind === 'FragmentDefinition' && externalFragments.includes(f.name.value));
|
|
142
146
|
if (insideIgnoredFragment) {
|
|
143
|
-
return;
|
|
147
|
+
return node;
|
|
144
148
|
}
|
|
145
149
|
foundFields++;
|
|
150
|
+
return undefined;
|
|
146
151
|
},
|
|
147
152
|
},
|
|
148
153
|
InputValueDefinition: {
|
|
149
154
|
enter: (node, key, parent, path, anscestors) => {
|
|
150
155
|
const insideIgnoredFragment = anscestors.find((f) => f.kind && f.kind === 'FragmentDefinition' && externalFragments.includes(f.name.value));
|
|
151
156
|
if (insideIgnoredFragment) {
|
|
152
|
-
return;
|
|
157
|
+
return node;
|
|
153
158
|
}
|
|
154
159
|
foundFields++;
|
|
160
|
+
return node;
|
|
155
161
|
},
|
|
156
162
|
},
|
|
157
163
|
});
|
package/esm/utils.js
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
|
-
import { isListType, isNonNullType } from 'graphql';
|
|
1
|
+
import { isListType, isNonNullType, } from 'graphql';
|
|
2
2
|
export function mergeOutputs(content) {
|
|
3
|
-
const result = {
|
|
3
|
+
const result = {
|
|
4
|
+
content: '',
|
|
5
|
+
prepend: [],
|
|
6
|
+
append: [],
|
|
7
|
+
};
|
|
4
8
|
if (Array.isArray(content)) {
|
|
5
9
|
for (const item of content) {
|
|
6
10
|
if (typeof item === 'string') {
|
package/package.json
CHANGED
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@depup/graphql-codegen__plugin-helpers",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "7.1.0-depup.8",
|
|
4
4
|
"description": "GraphQL Code Generator common utils and types (with updated dependencies)",
|
|
5
5
|
"peerDependencies": {
|
|
6
|
-
"graphql": "^0.8.0 || ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0"
|
|
6
|
+
"graphql": "^0.8.0 || ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0"
|
|
7
7
|
},
|
|
8
8
|
"dependencies": {
|
|
9
|
-
"@graphql-tools/utils": "^11.
|
|
9
|
+
"@graphql-tools/utils": "^11.2.2",
|
|
10
10
|
"change-case-all": "^2.1.0",
|
|
11
11
|
"common-tags": "1.8.2",
|
|
12
12
|
"import-from": "4.0.0",
|
|
13
|
-
"lodash": "^4.18.0",
|
|
14
13
|
"tslib": "^2.8.1"
|
|
15
14
|
},
|
|
16
15
|
"repository": {
|
|
@@ -56,23 +55,19 @@
|
|
|
56
55
|
],
|
|
57
56
|
"depup": {
|
|
58
57
|
"changes": {
|
|
59
|
-
"
|
|
60
|
-
"from": "
|
|
61
|
-
"to": "^2.
|
|
62
|
-
},
|
|
63
|
-
"lodash": {
|
|
64
|
-
"from": "~4.17.0",
|
|
65
|
-
"to": "^4.18.0"
|
|
58
|
+
"@graphql-tools/utils": {
|
|
59
|
+
"from": "^11.2.0",
|
|
60
|
+
"to": "^11.2.2"
|
|
66
61
|
},
|
|
67
62
|
"tslib": {
|
|
68
|
-
"from": "
|
|
63
|
+
"from": "^2.8.0",
|
|
69
64
|
"to": "^2.8.1"
|
|
70
65
|
}
|
|
71
66
|
},
|
|
72
|
-
"depsUpdated":
|
|
67
|
+
"depsUpdated": 2,
|
|
73
68
|
"originalPackage": "@graphql-codegen/plugin-helpers",
|
|
74
|
-
"originalVersion": "
|
|
75
|
-
"processedAt": "2026-
|
|
69
|
+
"originalVersion": "7.1.0",
|
|
70
|
+
"processedAt": "2026-07-21T16:05:27.114Z",
|
|
76
71
|
"smokeTest": "passed"
|
|
77
72
|
}
|
|
78
73
|
}
|
package/typings/federation.d.cts
CHANGED
|
@@ -32,7 +32,9 @@ export type FederationMeta = {
|
|
|
32
32
|
* - return type
|
|
33
33
|
* @param schema
|
|
34
34
|
*/
|
|
35
|
-
export declare function addFederationReferencesToSchema(schema: GraphQLSchema
|
|
35
|
+
export declare function addFederationReferencesToSchema(schema: GraphQLSchema, config: {
|
|
36
|
+
convertName: (type: string) => string;
|
|
37
|
+
}): {
|
|
36
38
|
transformedSchema: GraphQLSchema;
|
|
37
39
|
federationMeta: FederationMeta;
|
|
38
40
|
};
|
|
@@ -52,7 +54,7 @@ export declare class ApolloFederation {
|
|
|
52
54
|
*/
|
|
53
55
|
private fieldsToGenerate;
|
|
54
56
|
protected meta: FederationMeta;
|
|
55
|
-
constructor({ enabled, schema, meta }: {
|
|
57
|
+
constructor({ enabled, schema, meta, }: {
|
|
56
58
|
enabled: boolean;
|
|
57
59
|
schema: GraphQLSchema;
|
|
58
60
|
meta: FederationMeta;
|
package/typings/federation.d.ts
CHANGED
|
@@ -32,7 +32,9 @@ export type FederationMeta = {
|
|
|
32
32
|
* - return type
|
|
33
33
|
* @param schema
|
|
34
34
|
*/
|
|
35
|
-
export declare function addFederationReferencesToSchema(schema: GraphQLSchema
|
|
35
|
+
export declare function addFederationReferencesToSchema(schema: GraphQLSchema, config: {
|
|
36
|
+
convertName: (type: string) => string;
|
|
37
|
+
}): {
|
|
36
38
|
transformedSchema: GraphQLSchema;
|
|
37
39
|
federationMeta: FederationMeta;
|
|
38
40
|
};
|
|
@@ -52,7 +54,7 @@ export declare class ApolloFederation {
|
|
|
52
54
|
*/
|
|
53
55
|
private fieldsToGenerate;
|
|
54
56
|
protected meta: FederationMeta;
|
|
55
|
-
constructor({ enabled, schema, meta }: {
|
|
57
|
+
constructor({ enabled, schema, meta, }: {
|
|
56
58
|
enabled: boolean;
|
|
57
59
|
schema: GraphQLSchema;
|
|
58
60
|
meta: FederationMeta;
|
package/typings/oldVisit.d.cts
CHANGED
|
@@ -1,9 +1,2 @@
|
|
|
1
|
-
import { ASTNode
|
|
2
|
-
|
|
3
|
-
type NewVisitor = Partial<Parameters<VisitFn>[1]>;
|
|
4
|
-
type OldVisitor = {
|
|
5
|
-
enter?: Partial<Record<keyof NewVisitor, NonNullable<NewVisitor[keyof NewVisitor]>['enter']>>;
|
|
6
|
-
leave?: Partial<Record<keyof NewVisitor, NonNullable<NewVisitor[keyof NewVisitor]>['leave']>>;
|
|
7
|
-
} & NewVisitor;
|
|
8
|
-
export declare function oldVisit(root: ASTNode, { enter: enterVisitors, leave: leaveVisitors, ...newVisitor }: OldVisitor): any;
|
|
9
|
-
export {};
|
|
1
|
+
import { ASTNode } from 'graphql';
|
|
2
|
+
export declare function oldVisit(root: ASTNode, { enter: enterVisitors, leave: leaveVisitors, ...newVisitor }: any): any;
|
package/typings/oldVisit.d.ts
CHANGED
|
@@ -1,9 +1,2 @@
|
|
|
1
|
-
import { ASTNode
|
|
2
|
-
|
|
3
|
-
type NewVisitor = Partial<Parameters<VisitFn>[1]>;
|
|
4
|
-
type OldVisitor = {
|
|
5
|
-
enter?: Partial<Record<keyof NewVisitor, NonNullable<NewVisitor[keyof NewVisitor]>['enter']>>;
|
|
6
|
-
leave?: Partial<Record<keyof NewVisitor, NonNullable<NewVisitor[keyof NewVisitor]>['leave']>>;
|
|
7
|
-
} & NewVisitor;
|
|
8
|
-
export declare function oldVisit(root: ASTNode, { enter: enterVisitors, leave: leaveVisitors, ...newVisitor }: OldVisitor): any;
|
|
9
|
-
export {};
|
|
1
|
+
import { ASTNode } from 'graphql';
|
|
2
|
+
export declare function oldVisit(root: ASTNode, { enter: enterVisitors, leave: leaveVisitors, ...newVisitor }: any): any;
|
package/typings/types.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { DocumentNode, GraphQLSchema } from 'graphql';
|
|
1
2
|
import type { ApolloEngineOptions } from '@graphql-tools/apollo-engine-loader';
|
|
2
3
|
import { Source } from '@graphql-tools/utils';
|
|
3
|
-
import { DocumentNode, GraphQLSchema } from 'graphql';
|
|
4
4
|
import type { Profiler } from './profiler.cjs';
|
|
5
5
|
export declare namespace Types {
|
|
6
6
|
interface GenerateOptions {
|
|
@@ -34,7 +34,8 @@ export declare namespace Types {
|
|
|
34
34
|
};
|
|
35
35
|
};
|
|
36
36
|
interface DocumentFile extends Source {
|
|
37
|
-
hash?: string;
|
|
37
|
+
hash?: string | null;
|
|
38
|
+
type?: 'standard' | 'external';
|
|
38
39
|
}
|
|
39
40
|
type Promisable<T> = T | Promise<T>;
|
|
40
41
|
type InstanceOrArray<T> = T | T[];
|
|
@@ -272,6 +273,12 @@ export declare namespace Types {
|
|
|
272
273
|
* For more details: https://graphql-code-generator.com/docs/config-reference/documents-field
|
|
273
274
|
*/
|
|
274
275
|
documents?: InstanceOrArray<OperationDocument>;
|
|
276
|
+
/**
|
|
277
|
+
* @description A pointer(s) to your GraphQL documents that will be read but will not have type files generated for them.
|
|
278
|
+
* These documents are available to plugins for type resolution (e.g. fragment types), but no output files will be generated based on them.
|
|
279
|
+
* Accepts the same formats as `documents`.
|
|
280
|
+
*/
|
|
281
|
+
externalDocuments?: InstanceOrArray<OperationDocument>;
|
|
275
282
|
/**
|
|
276
283
|
* @description A pointer(s) to your GraphQL schema. This schema will be available only for this specific `generates` record.
|
|
277
284
|
* You can use one of the following:
|
|
@@ -389,6 +396,12 @@ export declare namespace Types {
|
|
|
389
396
|
* For more details: https://graphql-code-generator.com/docs/config-reference/documents-field
|
|
390
397
|
*/
|
|
391
398
|
documents?: InstanceOrArray<OperationDocument>;
|
|
399
|
+
/**
|
|
400
|
+
* @description A pointer(s) to your GraphQL documents that will be read but will not have type files generated for them.
|
|
401
|
+
* These documents are available to plugins for type resolution (e.g. fragment types), but no output files will be generated based on them.
|
|
402
|
+
* Accepts the same formats as `documents`.
|
|
403
|
+
*/
|
|
404
|
+
externalDocuments?: InstanceOrArray<OperationDocument>;
|
|
392
405
|
/**
|
|
393
406
|
* @type object
|
|
394
407
|
* @additionalProperties true
|
|
@@ -509,6 +522,10 @@ export declare namespace Types {
|
|
|
509
522
|
* @description If `true`, write to files whichever `generates` block succeeds. If `false`, one failed `generates` means no output is written to files. Default: false
|
|
510
523
|
*/
|
|
511
524
|
allowPartialOutputs?: boolean;
|
|
525
|
+
/**
|
|
526
|
+
* Working directory
|
|
527
|
+
*/
|
|
528
|
+
cwd?: string;
|
|
512
529
|
}
|
|
513
530
|
type ComplexPluginOutput<M = Record<string, unknown>> = {
|
|
514
531
|
content: string;
|
package/typings/types.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { DocumentNode, GraphQLSchema } from 'graphql';
|
|
1
2
|
import type { ApolloEngineOptions } from '@graphql-tools/apollo-engine-loader';
|
|
2
3
|
import { Source } from '@graphql-tools/utils';
|
|
3
|
-
import { DocumentNode, GraphQLSchema } from 'graphql';
|
|
4
4
|
import type { Profiler } from './profiler.js';
|
|
5
5
|
export declare namespace Types {
|
|
6
6
|
interface GenerateOptions {
|
|
@@ -34,7 +34,8 @@ export declare namespace Types {
|
|
|
34
34
|
};
|
|
35
35
|
};
|
|
36
36
|
interface DocumentFile extends Source {
|
|
37
|
-
hash?: string;
|
|
37
|
+
hash?: string | null;
|
|
38
|
+
type?: 'standard' | 'external';
|
|
38
39
|
}
|
|
39
40
|
type Promisable<T> = T | Promise<T>;
|
|
40
41
|
type InstanceOrArray<T> = T | T[];
|
|
@@ -272,6 +273,12 @@ export declare namespace Types {
|
|
|
272
273
|
* For more details: https://graphql-code-generator.com/docs/config-reference/documents-field
|
|
273
274
|
*/
|
|
274
275
|
documents?: InstanceOrArray<OperationDocument>;
|
|
276
|
+
/**
|
|
277
|
+
* @description A pointer(s) to your GraphQL documents that will be read but will not have type files generated for them.
|
|
278
|
+
* These documents are available to plugins for type resolution (e.g. fragment types), but no output files will be generated based on them.
|
|
279
|
+
* Accepts the same formats as `documents`.
|
|
280
|
+
*/
|
|
281
|
+
externalDocuments?: InstanceOrArray<OperationDocument>;
|
|
275
282
|
/**
|
|
276
283
|
* @description A pointer(s) to your GraphQL schema. This schema will be available only for this specific `generates` record.
|
|
277
284
|
* You can use one of the following:
|
|
@@ -389,6 +396,12 @@ export declare namespace Types {
|
|
|
389
396
|
* For more details: https://graphql-code-generator.com/docs/config-reference/documents-field
|
|
390
397
|
*/
|
|
391
398
|
documents?: InstanceOrArray<OperationDocument>;
|
|
399
|
+
/**
|
|
400
|
+
* @description A pointer(s) to your GraphQL documents that will be read but will not have type files generated for them.
|
|
401
|
+
* These documents are available to plugins for type resolution (e.g. fragment types), but no output files will be generated based on them.
|
|
402
|
+
* Accepts the same formats as `documents`.
|
|
403
|
+
*/
|
|
404
|
+
externalDocuments?: InstanceOrArray<OperationDocument>;
|
|
392
405
|
/**
|
|
393
406
|
* @type object
|
|
394
407
|
* @additionalProperties true
|
|
@@ -509,6 +522,10 @@ export declare namespace Types {
|
|
|
509
522
|
* @description If `true`, write to files whichever `generates` block succeeds. If `false`, one failed `generates` means no output is written to files. Default: false
|
|
510
523
|
*/
|
|
511
524
|
allowPartialOutputs?: boolean;
|
|
525
|
+
/**
|
|
526
|
+
* Working directory
|
|
527
|
+
*/
|
|
528
|
+
cwd?: string;
|
|
512
529
|
}
|
|
513
530
|
type ComplexPluginOutput<M = Record<string, unknown>> = {
|
|
514
531
|
content: string;
|