@graphql-codegen/typed-document-node 7.0.2 → 7.0.3-alpha-20260601135711-c7de66d21cb5b847190ede1d086709fee469cc0e
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 +1 -21
- package/esm/index.js +2 -22
- package/package.json +2 -2
package/cjs/index.js
CHANGED
|
@@ -24,27 +24,7 @@ const plugin = (schema, rawDocuments, config) => {
|
|
|
24
24
|
const visitorResult = (0, plugin_helpers_1.oldVisit)(allAst, { leave: visitor });
|
|
25
25
|
let content = [];
|
|
26
26
|
if (config.documentMode === visitor_plugin_common_1.DocumentMode.string) {
|
|
27
|
-
content = [
|
|
28
|
-
`\
|
|
29
|
-
export class TypedDocumentString<TResult, TVariables>
|
|
30
|
-
extends String
|
|
31
|
-
implements DocumentTypeDecoration<TResult, TVariables>
|
|
32
|
-
{
|
|
33
|
-
__apiType?: NonNullable<DocumentTypeDecoration<TResult, TVariables>['__apiType']>;
|
|
34
|
-
private value: string;
|
|
35
|
-
public __meta__?: Record<string, any> | undefined;
|
|
36
|
-
|
|
37
|
-
constructor(value: string, __meta__?: Record<string, any> | undefined) {
|
|
38
|
-
super(value);
|
|
39
|
-
this.value = value;
|
|
40
|
-
this.__meta__ = __meta__;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
override toString(): string & DocumentTypeDecoration<TResult, TVariables> {
|
|
44
|
-
return this.value;
|
|
45
|
-
}
|
|
46
|
-
}`,
|
|
47
|
-
];
|
|
27
|
+
content = [visitor_plugin_common_1.typedDocumentStringTemplate];
|
|
48
28
|
}
|
|
49
29
|
return {
|
|
50
30
|
prepend: allAst.definitions.length === 0 ? [] : visitor.getImports(),
|
package/esm/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { extname } from 'path';
|
|
2
2
|
import { concatAST, Kind } from 'graphql';
|
|
3
3
|
import { oldVisit } from '@graphql-codegen/plugin-helpers';
|
|
4
|
-
import { DocumentMode, optimizeOperations, } from '@graphql-codegen/visitor-plugin-common';
|
|
4
|
+
import { DocumentMode, optimizeOperations, typedDocumentStringTemplate, } from '@graphql-codegen/visitor-plugin-common';
|
|
5
5
|
import { TypeScriptDocumentNodesVisitor } from './visitor.js';
|
|
6
6
|
export const plugin = (schema, rawDocuments, config) => {
|
|
7
7
|
const documents = config.flattenGeneratedTypes
|
|
@@ -21,27 +21,7 @@ export const plugin = (schema, rawDocuments, config) => {
|
|
|
21
21
|
const visitorResult = oldVisit(allAst, { leave: visitor });
|
|
22
22
|
let content = [];
|
|
23
23
|
if (config.documentMode === DocumentMode.string) {
|
|
24
|
-
content = [
|
|
25
|
-
`\
|
|
26
|
-
export class TypedDocumentString<TResult, TVariables>
|
|
27
|
-
extends String
|
|
28
|
-
implements DocumentTypeDecoration<TResult, TVariables>
|
|
29
|
-
{
|
|
30
|
-
__apiType?: NonNullable<DocumentTypeDecoration<TResult, TVariables>['__apiType']>;
|
|
31
|
-
private value: string;
|
|
32
|
-
public __meta__?: Record<string, any> | undefined;
|
|
33
|
-
|
|
34
|
-
constructor(value: string, __meta__?: Record<string, any> | undefined) {
|
|
35
|
-
super(value);
|
|
36
|
-
this.value = value;
|
|
37
|
-
this.__meta__ = __meta__;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
override toString(): string & DocumentTypeDecoration<TResult, TVariables> {
|
|
41
|
-
return this.value;
|
|
42
|
-
}
|
|
43
|
-
}`,
|
|
44
|
-
];
|
|
24
|
+
content = [typedDocumentStringTemplate];
|
|
45
25
|
}
|
|
46
26
|
return {
|
|
47
27
|
prepend: allAst.definitions.length === 0 ? [] : visitor.getImports(),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@graphql-codegen/typed-document-node",
|
|
3
|
-
"version": "7.0.
|
|
3
|
+
"version": "7.0.3-alpha-20260601135711-c7de66d21cb5b847190ede1d086709fee469cc0e",
|
|
4
4
|
"description": "GraphQL Code Generator plugin for generating ready-to-use TypedDocumentNode based on GraphQL operations",
|
|
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"
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"change-case-all": "^2.1.0",
|
|
11
11
|
"tslib": "^2.8.0",
|
|
12
12
|
"@graphql-codegen/plugin-helpers": "^7.0.1",
|
|
13
|
-
"@graphql-codegen/visitor-plugin-common": "^7.0
|
|
13
|
+
"@graphql-codegen/visitor-plugin-common": "^7.1.0-alpha-20260601135711-c7de66d21cb5b847190ede1d086709fee469cc0e"
|
|
14
14
|
},
|
|
15
15
|
"repository": {
|
|
16
16
|
"type": "git",
|