@depup/graphql-codegen__plugin-helpers 6.2.1-depup.0 → 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 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,8 +13,8 @@ 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) @ 6.2.1 |
17
- | Processed | 2026-04-04 |
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
19
  | Deps updated | 2 |
20
20
 
@@ -22,8 +22,8 @@ npm install @depup/graphql-codegen__plugin-helpers
22
22
 
23
23
  | Dependency | From | To |
24
24
  |------------|------|-----|
25
- | change-case-all | 1.0.15 | ^2.1.0 |
26
- | 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 |
27
27
 
28
28
  ---
29
29
 
package/changes.json CHANGED
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "bumped": {
3
- "change-case-all": {
4
- "from": "1.0.15",
5
- "to": "^2.1.0"
3
+ "@graphql-tools/utils": {
4
+ "from": "^11.2.0",
5
+ "to": "^11.2.2"
6
6
  },
7
7
  "tslib": {
8
- "from": "~2.6.0",
8
+ "from": "^2.8.0",
9
9
  "to": "^2.8.1"
10
10
  }
11
11
  },
12
- "timestamp": "2026-04-04T04:39:20.177Z",
12
+ "timestamp": "2026-07-21T16:05:24.059Z",
13
13
  "totalUpdated": 2
14
14
  }
package/cjs/federation.js CHANGED
@@ -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] ||
@@ -155,6 +155,8 @@ function addFederationReferencesToSchema(schema) {
155
155
  typeConfig.fields = {
156
156
  [resolveReferenceFieldName]: {
157
157
  type,
158
+ args: {},
159
+ extensions: {},
158
160
  },
159
161
  ...typeConfig.fields,
160
162
  };
@@ -164,7 +166,7 @@ function addFederationReferencesToSchema(schema) {
164
166
  });
165
167
  const referenceSelectionSetsString = printReferenceSelectionSets({
166
168
  typeName: type.name,
167
- baseFederationType: `FederationTypes['${type.name}']`, // FIXME: run convertName on FederationTypes
169
+ baseFederationType: `${config.convertName('FederationTypes')}['${type.name}']`,
168
170
  referenceSelectionSets,
169
171
  });
170
172
  setFederationMeta({
@@ -193,12 +195,14 @@ function addFederationReferencesToSchema(schema) {
193
195
  typeConfig.fields = {
194
196
  [resolveReferenceFieldName]: {
195
197
  type,
198
+ args: {},
199
+ extensions: {},
196
200
  },
197
201
  ...typeConfig.fields,
198
202
  };
199
203
  const referenceSelectionSetsString = printReferenceSelectionSets({
200
204
  typeName: type.name,
201
- baseFederationType: `FederationTypes['${type.name}']`, // FIXME: run convertName on FederationTypes
205
+ baseFederationType: `${config.convertName('FederationTypes')}['${type.name}']`,
202
206
  referenceSelectionSets,
203
207
  });
204
208
  setFederationMeta({
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/esm/federation.js CHANGED
@@ -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] ||
@@ -150,6 +150,8 @@ export function addFederationReferencesToSchema(schema) {
150
150
  typeConfig.fields = {
151
151
  [resolveReferenceFieldName]: {
152
152
  type,
153
+ args: {},
154
+ extensions: {},
153
155
  },
154
156
  ...typeConfig.fields,
155
157
  };
@@ -159,7 +161,7 @@ export function addFederationReferencesToSchema(schema) {
159
161
  });
160
162
  const referenceSelectionSetsString = printReferenceSelectionSets({
161
163
  typeName: type.name,
162
- baseFederationType: `FederationTypes['${type.name}']`, // FIXME: run convertName on FederationTypes
164
+ baseFederationType: `${config.convertName('FederationTypes')}['${type.name}']`,
163
165
  referenceSelectionSets,
164
166
  });
165
167
  setFederationMeta({
@@ -188,12 +190,14 @@ export function addFederationReferencesToSchema(schema) {
188
190
  typeConfig.fields = {
189
191
  [resolveReferenceFieldName]: {
190
192
  type,
193
+ args: {},
194
+ extensions: {},
191
195
  },
192
196
  ...typeConfig.fields,
193
197
  };
194
198
  const referenceSelectionSetsString = printReferenceSelectionSets({
195
199
  typeName: type.name,
196
- baseFederationType: `FederationTypes['${type.name}']`, // FIXME: run convertName on FederationTypes
200
+ baseFederationType: `${config.convertName('FederationTypes')}['${type.name}']`,
197
201
  referenceSelectionSets,
198
202
  });
199
203
  setFederationMeta({
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/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@depup/graphql-codegen__plugin-helpers",
3
- "version": "6.2.1-depup.0",
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.0.0",
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",
@@ -55,19 +55,19 @@
55
55
  ],
56
56
  "depup": {
57
57
  "changes": {
58
- "change-case-all": {
59
- "from": "1.0.15",
60
- "to": "^2.1.0"
58
+ "@graphql-tools/utils": {
59
+ "from": "^11.2.0",
60
+ "to": "^11.2.2"
61
61
  },
62
62
  "tslib": {
63
- "from": "~2.6.0",
63
+ "from": "^2.8.0",
64
64
  "to": "^2.8.1"
65
65
  }
66
66
  },
67
67
  "depsUpdated": 2,
68
68
  "originalPackage": "@graphql-codegen/plugin-helpers",
69
- "originalVersion": "6.2.1",
70
- "processedAt": "2026-04-04T04:39:22.123Z",
69
+ "originalVersion": "7.1.0",
70
+ "processedAt": "2026-07-21T16:05:27.114Z",
71
71
  "smokeTest": "passed"
72
72
  }
73
73
  }
@@ -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
  };
@@ -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
  };
@@ -1,9 +1,2 @@
1
- import { ASTNode, visit } from 'graphql';
2
- type VisitFn = typeof visit;
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;
@@ -1,9 +1,2 @@
1
- import { ASTNode, visit } from 'graphql';
2
- type VisitFn = typeof visit;
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;
@@ -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;
@@ -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;