@graphql-codegen/visitor-plugin-common 7.1.2 → 7.1.3-alpha-20260706100445-26fa6516d5193ab4e1a3ccb82b4eab51712eb2ac
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.
|
@@ -208,7 +208,7 @@ class ClientSideBaseVisitor extends base_visitor_js_1.BaseVisitor {
|
|
|
208
208
|
while (queue.length) {
|
|
209
209
|
const selection = queue.shift();
|
|
210
210
|
if (selection.kind === graphql_1.Kind.FRAGMENT_SPREAD &&
|
|
211
|
-
selection.directives
|
|
211
|
+
selection.directives?.some((d) => d.name.value === 'defer')) {
|
|
212
212
|
const fragmentName = selection.name.value;
|
|
213
213
|
const fragment = this.fragmentsGraph.getNodeData(fragmentName);
|
|
214
214
|
if (fragment) {
|
|
@@ -182,7 +182,7 @@ class SelectionSetToObject {
|
|
|
182
182
|
if (originalNode.kind === graphql_1.Kind.FIELD) {
|
|
183
183
|
return {
|
|
184
184
|
...originalNode,
|
|
185
|
-
fragmentDirectives: [...spread.directives],
|
|
185
|
+
fragmentDirectives: [...(spread.directives || [])],
|
|
186
186
|
};
|
|
187
187
|
}
|
|
188
188
|
return originalNode;
|
|
@@ -192,7 +192,7 @@ class SelectionSetToObject {
|
|
|
192
192
|
typeName: usage,
|
|
193
193
|
onType: fragmentSpreadObject.onType,
|
|
194
194
|
selectionNodes: fragmentSelectionNodes,
|
|
195
|
-
fragmentDirectives: [...spread.directives],
|
|
195
|
+
fragmentDirectives: [...(spread.directives || [])],
|
|
196
196
|
});
|
|
197
197
|
}
|
|
198
198
|
}
|
package/cjs/utils.js
CHANGED
|
@@ -540,7 +540,7 @@ const getFieldNames = ({ selections, fieldNames = new Set(), parentName = '', lo
|
|
|
540
540
|
exports.getFieldNames = getFieldNames;
|
|
541
541
|
const getNodeComment = (node) => {
|
|
542
542
|
let commentText = node.description?.value;
|
|
543
|
-
const deprecationDirective = node.directives
|
|
543
|
+
const deprecationDirective = node.directives?.find(v => v.name.value === 'deprecated');
|
|
544
544
|
if (deprecationDirective) {
|
|
545
545
|
const deprecationReason = getDeprecationReason(deprecationDirective);
|
|
546
546
|
commentText = `${commentText ? `${commentText}\n` : ''}@deprecated ${deprecationReason}`;
|
|
@@ -204,7 +204,7 @@ export class ClientSideBaseVisitor extends BaseVisitor {
|
|
|
204
204
|
while (queue.length) {
|
|
205
205
|
const selection = queue.shift();
|
|
206
206
|
if (selection.kind === Kind.FRAGMENT_SPREAD &&
|
|
207
|
-
selection.directives
|
|
207
|
+
selection.directives?.some((d) => d.name.value === 'defer')) {
|
|
208
208
|
const fragmentName = selection.name.value;
|
|
209
209
|
const fragment = this.fragmentsGraph.getNodeData(fragmentName);
|
|
210
210
|
if (fragment) {
|
|
@@ -178,7 +178,7 @@ export class SelectionSetToObject {
|
|
|
178
178
|
if (originalNode.kind === Kind.FIELD) {
|
|
179
179
|
return {
|
|
180
180
|
...originalNode,
|
|
181
|
-
fragmentDirectives: [...spread.directives],
|
|
181
|
+
fragmentDirectives: [...(spread.directives || [])],
|
|
182
182
|
};
|
|
183
183
|
}
|
|
184
184
|
return originalNode;
|
|
@@ -188,7 +188,7 @@ export class SelectionSetToObject {
|
|
|
188
188
|
typeName: usage,
|
|
189
189
|
onType: fragmentSpreadObject.onType,
|
|
190
190
|
selectionNodes: fragmentSelectionNodes,
|
|
191
|
-
fragmentDirectives: [...spread.directives],
|
|
191
|
+
fragmentDirectives: [...(spread.directives || [])],
|
|
192
192
|
});
|
|
193
193
|
}
|
|
194
194
|
}
|
package/esm/utils.js
CHANGED
|
@@ -510,7 +510,7 @@ export const getFieldNames = ({ selections, fieldNames = new Set(), parentName =
|
|
|
510
510
|
};
|
|
511
511
|
export const getNodeComment = (node) => {
|
|
512
512
|
let commentText = node.description?.value;
|
|
513
|
-
const deprecationDirective = node.directives
|
|
513
|
+
const deprecationDirective = node.directives?.find(v => v.name.value === 'deprecated');
|
|
514
514
|
if (deprecationDirective) {
|
|
515
515
|
const deprecationReason = getDeprecationReason(deprecationDirective);
|
|
516
516
|
commentText = `${commentText ? `${commentText}\n` : ''}@deprecated ${deprecationReason}`;
|
package/package.json
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@graphql-codegen/visitor-plugin-common",
|
|
3
|
-
"version": "7.1.
|
|
3
|
+
"version": "7.1.3-alpha-20260706100445-26fa6516d5193ab4e1a3ccb82b4eab51712eb2ac",
|
|
4
4
|
"peerDependencies": {
|
|
5
|
-
"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"
|
|
5
|
+
"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"
|
|
6
6
|
},
|
|
7
7
|
"dependencies": {
|
|
8
8
|
"@graphql-tools/optimize": "^2.0.0",
|
|
9
9
|
"@graphql-tools/relay-operation-optimizer": "^7.1.1",
|
|
10
|
-
"@graphql-tools/utils": "
|
|
10
|
+
"@graphql-tools/utils": "11.2.0-rc-20260703111316-6d117ceb02d4f6851c3929ab27f73e0fd8df235c",
|
|
11
11
|
"auto-bind": "^5.0.0",
|
|
12
12
|
"change-case-all": "^2.1.0",
|
|
13
13
|
"dependency-graph": "^1.0.0",
|
|
14
14
|
"graphql-tag": "^2.11.0",
|
|
15
15
|
"parse-filepath": "^1.0.2",
|
|
16
16
|
"tslib": "^2.8.0",
|
|
17
|
-
"@graphql-codegen/plugin-helpers": "^7.0.
|
|
17
|
+
"@graphql-codegen/plugin-helpers": "^7.0.2-alpha-20260706100445-26fa6516d5193ab4e1a3ccb82b4eab51712eb2ac"
|
|
18
18
|
},
|
|
19
19
|
"repository": {
|
|
20
20
|
"type": "git",
|