@graphql-codegen/typescript-document-nodes 6.1.0 → 6.1.1-alpha-20260925063940-9ae630f839ac00a5cd73196e832697845f07b30e
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 +4 -2
- package/esm/index.js +4 -2
- package/package.json +4 -4
package/cjs/index.js
CHANGED
|
@@ -5,7 +5,9 @@ const graphql_1 = require("graphql");
|
|
|
5
5
|
const plugin_helpers_1 = require("@graphql-codegen/plugin-helpers");
|
|
6
6
|
const visitor_js_1 = require("./visitor.js");
|
|
7
7
|
const plugin = (schema, documents, config) => {
|
|
8
|
-
const allAst = (0, graphql_1.concatAST)(documents
|
|
8
|
+
const allAst = (0, graphql_1.concatAST)(documents
|
|
9
|
+
.filter((v) => !!v.document)
|
|
10
|
+
.map(v => v.document));
|
|
9
11
|
const allFragments = [
|
|
10
12
|
...allAst.definitions.filter(d => d.kind === graphql_1.Kind.FRAGMENT_DEFINITION).map(fragmentDef => ({
|
|
11
13
|
node: fragmentDef,
|
|
@@ -21,7 +23,7 @@ const plugin = (schema, documents, config) => {
|
|
|
21
23
|
prepend: visitor.getImports(),
|
|
22
24
|
content: [
|
|
23
25
|
visitor.fragments,
|
|
24
|
-
...visitorResult.definitions.filter(t => typeof t === 'string'),
|
|
26
|
+
...visitorResult.definitions.filter((t) => typeof t === 'string'),
|
|
25
27
|
].join('\n'),
|
|
26
28
|
};
|
|
27
29
|
};
|
package/esm/index.js
CHANGED
|
@@ -2,7 +2,9 @@ import { concatAST, Kind } from 'graphql';
|
|
|
2
2
|
import { oldVisit } from '@graphql-codegen/plugin-helpers';
|
|
3
3
|
import { TypeScriptDocumentNodesVisitor } from './visitor.js';
|
|
4
4
|
export const plugin = (schema, documents, config) => {
|
|
5
|
-
const allAst = concatAST(documents
|
|
5
|
+
const allAst = concatAST(documents
|
|
6
|
+
.filter((v) => !!v.document)
|
|
7
|
+
.map(v => v.document));
|
|
6
8
|
const allFragments = [
|
|
7
9
|
...allAst.definitions.filter(d => d.kind === Kind.FRAGMENT_DEFINITION).map(fragmentDef => ({
|
|
8
10
|
node: fragmentDef,
|
|
@@ -18,7 +20,7 @@ export const plugin = (schema, documents, config) => {
|
|
|
18
20
|
prepend: visitor.getImports(),
|
|
19
21
|
content: [
|
|
20
22
|
visitor.fragments,
|
|
21
|
-
...visitorResult.definitions.filter(t => typeof t === 'string'),
|
|
23
|
+
...visitorResult.definitions.filter((t) => typeof t === 'string'),
|
|
22
24
|
].join('\n'),
|
|
23
25
|
};
|
|
24
26
|
};
|
package/package.json
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@graphql-codegen/typescript-document-nodes",
|
|
3
|
-
"version": "6.1.
|
|
3
|
+
"version": "6.1.1-alpha-20260925063940-9ae630f839ac00a5cd73196e832697845f07b30e",
|
|
4
4
|
"description": "GraphQL Code Generator plugin for generating TypeScript modules with embedded GraphQL document nodes",
|
|
5
5
|
"peerDependencies": {
|
|
6
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-codegen/plugin-helpers": "^7.3.0",
|
|
10
|
+
"@graphql-codegen/visitor-plugin-common": "^7.2.5",
|
|
9
11
|
"auto-bind": "^5.0.0",
|
|
10
|
-
"tslib": "^2.8.0"
|
|
11
|
-
"@graphql-codegen/plugin-helpers": "^7.1.0",
|
|
12
|
-
"@graphql-codegen/visitor-plugin-common": "^7.2.0"
|
|
12
|
+
"tslib": "^2.8.0"
|
|
13
13
|
},
|
|
14
14
|
"repository": {
|
|
15
15
|
"type": "git",
|