@graphql-codegen/visitor-plugin-common 6.0.0-alpha-20250812131146-d8919a6237f19450de571b59081b880c2e7d3494 → 6.0.0-alpha-20250813125320-63ac348b428178b17ad9fae069ce727ffddb8744
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/base-documents-visitor.js +5 -2
- package/cjs/base-resolvers-visitor.js +28 -22
- package/cjs/base-types-visitor.js +2 -0
- package/cjs/base-visitor.js +3 -1
- package/cjs/client-side-base-visitor.js +9 -4
- package/cjs/selection-set-processor/base.js +2 -1
- package/cjs/selection-set-to-object.js +13 -4
- package/cjs/utils.js +11 -10
- package/cjs/variables-to-object.js +9 -0
- package/esm/base-documents-visitor.js +5 -2
- package/esm/base-resolvers-visitor.js +28 -22
- package/esm/base-types-visitor.js +2 -0
- package/esm/base-visitor.js +3 -1
- package/esm/client-side-base-visitor.js +9 -4
- package/esm/selection-set-processor/base.js +2 -1
- package/esm/selection-set-to-object.js +13 -4
- package/esm/utils.js +11 -10
- package/esm/variables-to-object.js +9 -0
- package/package.json +2 -2
|
@@ -20,6 +20,11 @@ function getRootType(operation, schema) {
|
|
|
20
20
|
throw new Error(`Unknown operation type: ${operation}`);
|
|
21
21
|
}
|
|
22
22
|
class BaseDocumentsVisitor extends base_visitor_js_1.BaseVisitor {
|
|
23
|
+
_schema;
|
|
24
|
+
_unnamedCounter = 1;
|
|
25
|
+
_variablesTransfomer;
|
|
26
|
+
_selectionSetToObject;
|
|
27
|
+
_globalDeclarations = new Set();
|
|
23
28
|
constructor(rawConfig, additionalConfig, _schema, defaultScalars = scalars_js_1.DEFAULT_SCALARS) {
|
|
24
29
|
super(rawConfig, {
|
|
25
30
|
exportFragmentSpreadSubTypes: (0, utils_js_1.getConfigValue)(rawConfig.exportFragmentSpreadSubTypes, false),
|
|
@@ -39,8 +44,6 @@ class BaseDocumentsVisitor extends base_visitor_js_1.BaseVisitor {
|
|
|
39
44
|
...(additionalConfig || {}),
|
|
40
45
|
});
|
|
41
46
|
this._schema = _schema;
|
|
42
|
-
this._unnamedCounter = 1;
|
|
43
|
-
this._globalDeclarations = new Set();
|
|
44
47
|
(0, auto_bind_1.default)(this);
|
|
45
48
|
this._variablesTransfomer = new variables_to_object_js_1.OperationVariablesToObject(this.scalars, this.convertName, this.config.namespacedImportName);
|
|
46
49
|
}
|
|
@@ -14,6 +14,34 @@ const utils_js_1 = require("./utils.js");
|
|
|
14
14
|
const variables_to_object_js_1 = require("./variables-to-object.js");
|
|
15
15
|
const avoid_optionals_js_1 = require("./avoid-optionals.js");
|
|
16
16
|
class BaseResolversVisitor extends base_visitor_js_1.BaseVisitor {
|
|
17
|
+
_schema;
|
|
18
|
+
_declarationBlockConfig = {};
|
|
19
|
+
_collectedResolvers = {};
|
|
20
|
+
_parsedSchemaMeta = {
|
|
21
|
+
types: {
|
|
22
|
+
interface: {},
|
|
23
|
+
union: {},
|
|
24
|
+
},
|
|
25
|
+
typesWithIsTypeOf: {},
|
|
26
|
+
};
|
|
27
|
+
_collectedDirectiveResolvers = {};
|
|
28
|
+
_variablesTransformer;
|
|
29
|
+
_usedMappers = {};
|
|
30
|
+
_resolversTypes = {};
|
|
31
|
+
_resolversParentTypes = {};
|
|
32
|
+
_hasReferencedResolversUnionTypes = false;
|
|
33
|
+
_hasReferencedResolversInterfaceTypes = false;
|
|
34
|
+
_resolversUnionTypes = {};
|
|
35
|
+
_resolversInterfaceTypes = {};
|
|
36
|
+
_rootTypeNames = new Set();
|
|
37
|
+
_globalDeclarations = new Set();
|
|
38
|
+
_federation;
|
|
39
|
+
_hasScalars = false;
|
|
40
|
+
_fieldContextTypeMap;
|
|
41
|
+
_directiveContextTypesMap;
|
|
42
|
+
_checkedTypesWithNestedAbstractTypes = {};
|
|
43
|
+
_directiveResolverMappings;
|
|
44
|
+
_shouldMapType = {};
|
|
17
45
|
constructor(rawConfig, additionalConfig, _schema, defaultScalars = scalars_js_1.DEFAULT_SCALARS, federationMeta = {}) {
|
|
18
46
|
super(rawConfig, {
|
|
19
47
|
immutableTypes: (0, utils_js_1.getConfigValue)(rawConfig.immutableTypes, false),
|
|
@@ -47,28 +75,6 @@ class BaseResolversVisitor extends base_visitor_js_1.BaseVisitor {
|
|
|
47
75
|
...additionalConfig,
|
|
48
76
|
});
|
|
49
77
|
this._schema = _schema;
|
|
50
|
-
this._declarationBlockConfig = {};
|
|
51
|
-
this._collectedResolvers = {};
|
|
52
|
-
this._parsedSchemaMeta = {
|
|
53
|
-
types: {
|
|
54
|
-
interface: {},
|
|
55
|
-
union: {},
|
|
56
|
-
},
|
|
57
|
-
typesWithIsTypeOf: {},
|
|
58
|
-
};
|
|
59
|
-
this._collectedDirectiveResolvers = {};
|
|
60
|
-
this._usedMappers = {};
|
|
61
|
-
this._resolversTypes = {};
|
|
62
|
-
this._resolversParentTypes = {};
|
|
63
|
-
this._hasReferencedResolversUnionTypes = false;
|
|
64
|
-
this._hasReferencedResolversInterfaceTypes = false;
|
|
65
|
-
this._resolversUnionTypes = {};
|
|
66
|
-
this._resolversInterfaceTypes = {};
|
|
67
|
-
this._rootTypeNames = new Set();
|
|
68
|
-
this._globalDeclarations = new Set();
|
|
69
|
-
this._hasScalars = false;
|
|
70
|
-
this._checkedTypesWithNestedAbstractTypes = {};
|
|
71
|
-
this._shouldMapType = {};
|
|
72
78
|
(0, auto_bind_1.default)(this);
|
|
73
79
|
this._federation = new plugin_helpers_1.ApolloFederation({
|
|
74
80
|
enabled: this.config.federation,
|
|
@@ -10,6 +10,8 @@ const scalars_js_1 = require("./scalars.js");
|
|
|
10
10
|
const utils_js_1 = require("./utils.js");
|
|
11
11
|
const variables_to_object_js_1 = require("./variables-to-object.js");
|
|
12
12
|
class BaseTypesVisitor extends base_visitor_js_1.BaseVisitor {
|
|
13
|
+
_schema;
|
|
14
|
+
_argumentsTransformer;
|
|
13
15
|
constructor(_schema, rawConfig, additionalConfig, defaultScalars = scalars_js_1.DEFAULT_SCALARS) {
|
|
14
16
|
super(rawConfig, {
|
|
15
17
|
enumPrefix: (0, utils_js_1.getConfigValue)(rawConfig.enumPrefix, true),
|
package/cjs/base-visitor.js
CHANGED
|
@@ -5,8 +5,10 @@ const tslib_1 = require("tslib");
|
|
|
5
5
|
const auto_bind_1 = tslib_1.__importDefault(require("auto-bind"));
|
|
6
6
|
const naming_js_1 = require("./naming.js");
|
|
7
7
|
class BaseVisitor {
|
|
8
|
+
_parsedConfig;
|
|
9
|
+
_declarationBlockConfig = {};
|
|
10
|
+
scalars;
|
|
8
11
|
constructor(rawConfig, additionalConfig) {
|
|
9
|
-
this._declarationBlockConfig = {};
|
|
10
12
|
this._parsedConfig = {
|
|
11
13
|
convert: (0, naming_js_1.convertFactory)(rawConfig),
|
|
12
14
|
typesPrefix: rawConfig.typesPrefix || '',
|
|
@@ -24,6 +24,15 @@ var DocumentMode;
|
|
|
24
24
|
})(DocumentMode || (exports.DocumentMode = DocumentMode = {}));
|
|
25
25
|
const EXTENSIONS_TO_REMOVE = ['.ts', '.tsx', '.js', '.jsx'];
|
|
26
26
|
class ClientSideBaseVisitor extends base_visitor_js_1.BaseVisitor {
|
|
27
|
+
_schema;
|
|
28
|
+
_collectedOperations = [];
|
|
29
|
+
_documents = [];
|
|
30
|
+
_additionalImports = [];
|
|
31
|
+
_imports = new Set();
|
|
32
|
+
_onExecutableDocumentNode;
|
|
33
|
+
_omitDefinitions;
|
|
34
|
+
_fragments;
|
|
35
|
+
fragmentsGraph;
|
|
27
36
|
constructor(_schema, fragments, rawConfig, additionalConfig, documents) {
|
|
28
37
|
super(rawConfig, {
|
|
29
38
|
scalars: (0, utils_js_1.buildScalarsFromConfig)(_schema, rawConfig),
|
|
@@ -51,10 +60,6 @@ class ClientSideBaseVisitor extends base_visitor_js_1.BaseVisitor {
|
|
|
51
60
|
...additionalConfig,
|
|
52
61
|
});
|
|
53
62
|
this._schema = _schema;
|
|
54
|
-
this._collectedOperations = [];
|
|
55
|
-
this._documents = [];
|
|
56
|
-
this._additionalImports = [];
|
|
57
|
-
this._imports = new Set();
|
|
58
63
|
this._documents = documents;
|
|
59
64
|
this._onExecutableDocumentNode = rawConfig.unstable_onExecutableDocumentNode;
|
|
60
65
|
this._omitDefinitions = rawConfig.unstable_omitDefinitions;
|
|
@@ -2,9 +2,10 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.BaseSelectionSetProcessor = void 0;
|
|
4
4
|
class BaseSelectionSetProcessor {
|
|
5
|
+
config;
|
|
6
|
+
typeCache = new Map();
|
|
5
7
|
constructor(config) {
|
|
6
8
|
this.config = config;
|
|
7
|
-
this.typeCache = new Map();
|
|
8
9
|
}
|
|
9
10
|
buildFieldsIntoObject(allObjectsMerged) {
|
|
10
11
|
if (this.config.printFieldsOnNewLines) {
|
|
@@ -17,6 +17,19 @@ const metadataFieldMap = {
|
|
|
17
17
|
__type: graphql_1.TypeMetaFieldDef,
|
|
18
18
|
};
|
|
19
19
|
class SelectionSetToObject {
|
|
20
|
+
_processor;
|
|
21
|
+
_scalars;
|
|
22
|
+
_schema;
|
|
23
|
+
_convertName;
|
|
24
|
+
_getFragmentSuffix;
|
|
25
|
+
_loadedFragments;
|
|
26
|
+
_config;
|
|
27
|
+
_parentSchemaType;
|
|
28
|
+
_selectionSet;
|
|
29
|
+
_primitiveFields = [];
|
|
30
|
+
_primitiveAliasedFields = [];
|
|
31
|
+
_linksFields = [];
|
|
32
|
+
_queriedForTypename = false;
|
|
20
33
|
constructor(_processor, _scalars, _schema, _convertName, _getFragmentSuffix, _loadedFragments, _config, _parentSchemaType, _selectionSet) {
|
|
21
34
|
this._processor = _processor;
|
|
22
35
|
this._scalars = _scalars;
|
|
@@ -27,10 +40,6 @@ class SelectionSetToObject {
|
|
|
27
40
|
this._config = _config;
|
|
28
41
|
this._parentSchemaType = _parentSchemaType;
|
|
29
42
|
this._selectionSet = _selectionSet;
|
|
30
|
-
this._primitiveFields = [];
|
|
31
|
-
this._primitiveAliasedFields = [];
|
|
32
|
-
this._linksFields = [];
|
|
33
|
-
this._queriedForTypename = false;
|
|
34
43
|
(0, auto_bind_1.default)(this);
|
|
35
44
|
}
|
|
36
45
|
createNext(parentSchemaType, selectionSet) {
|
package/cjs/utils.js
CHANGED
|
@@ -88,18 +88,19 @@ function transformComment(comment, indentLevel = 0, disabled = false) {
|
|
|
88
88
|
return stripTrailingSpaces(lines.map(line => indent(line, indentLevel)).join('\n'));
|
|
89
89
|
}
|
|
90
90
|
class DeclarationBlock {
|
|
91
|
+
_config;
|
|
92
|
+
_decorator = null;
|
|
93
|
+
_export = false;
|
|
94
|
+
_name = null;
|
|
95
|
+
_kind = null;
|
|
96
|
+
_methodName = null;
|
|
97
|
+
_content = null;
|
|
98
|
+
_block = null;
|
|
99
|
+
_nameGenerics = null;
|
|
100
|
+
_comment = null;
|
|
101
|
+
_ignoreBlockWrapper = false;
|
|
91
102
|
constructor(_config) {
|
|
92
103
|
this._config = _config;
|
|
93
|
-
this._decorator = null;
|
|
94
|
-
this._export = false;
|
|
95
|
-
this._name = null;
|
|
96
|
-
this._kind = null;
|
|
97
|
-
this._methodName = null;
|
|
98
|
-
this._content = null;
|
|
99
|
-
this._block = null;
|
|
100
|
-
this._nameGenerics = null;
|
|
101
|
-
this._comment = null;
|
|
102
|
-
this._ignoreBlockWrapper = false;
|
|
103
104
|
this._config = {
|
|
104
105
|
blockWrapper: '',
|
|
105
106
|
blockTransformer: block => block,
|
|
@@ -6,6 +6,15 @@ const auto_bind_1 = tslib_1.__importDefault(require("auto-bind"));
|
|
|
6
6
|
const graphql_1 = require("graphql");
|
|
7
7
|
const utils_js_1 = require("./utils.js");
|
|
8
8
|
class OperationVariablesToObject {
|
|
9
|
+
_scalars;
|
|
10
|
+
_convertName;
|
|
11
|
+
_namespacedImportName;
|
|
12
|
+
_enumNames;
|
|
13
|
+
_enumPrefix;
|
|
14
|
+
_enumSuffix;
|
|
15
|
+
_enumValues;
|
|
16
|
+
_applyCoercion;
|
|
17
|
+
_directiveArgumentAndInputFieldMappings;
|
|
9
18
|
constructor(_scalars, _convertName, _namespacedImportName = null, _enumNames = [], _enumPrefix = true, _enumSuffix = true, _enumValues = {}, _applyCoercion = false, _directiveArgumentAndInputFieldMappings = {}) {
|
|
10
19
|
this._scalars = _scalars;
|
|
11
20
|
this._convertName = _convertName;
|
|
@@ -16,6 +16,11 @@ function getRootType(operation, schema) {
|
|
|
16
16
|
throw new Error(`Unknown operation type: ${operation}`);
|
|
17
17
|
}
|
|
18
18
|
export class BaseDocumentsVisitor extends BaseVisitor {
|
|
19
|
+
_schema;
|
|
20
|
+
_unnamedCounter = 1;
|
|
21
|
+
_variablesTransfomer;
|
|
22
|
+
_selectionSetToObject;
|
|
23
|
+
_globalDeclarations = new Set();
|
|
19
24
|
constructor(rawConfig, additionalConfig, _schema, defaultScalars = DEFAULT_SCALARS) {
|
|
20
25
|
super(rawConfig, {
|
|
21
26
|
exportFragmentSpreadSubTypes: getConfigValue(rawConfig.exportFragmentSpreadSubTypes, false),
|
|
@@ -35,8 +40,6 @@ export class BaseDocumentsVisitor extends BaseVisitor {
|
|
|
35
40
|
...(additionalConfig || {}),
|
|
36
41
|
});
|
|
37
42
|
this._schema = _schema;
|
|
38
|
-
this._unnamedCounter = 1;
|
|
39
|
-
this._globalDeclarations = new Set();
|
|
40
43
|
autoBind(this);
|
|
41
44
|
this._variablesTransfomer = new OperationVariablesToObject(this.scalars, this.convertName, this.config.namespacedImportName);
|
|
42
45
|
}
|
|
@@ -10,6 +10,34 @@ import { buildScalarsFromConfig, DeclarationBlock, getBaseTypeNode, getConfigVal
|
|
|
10
10
|
import { OperationVariablesToObject } from './variables-to-object.js';
|
|
11
11
|
import { normalizeAvoidOptionals } from './avoid-optionals.js';
|
|
12
12
|
export class BaseResolversVisitor extends BaseVisitor {
|
|
13
|
+
_schema;
|
|
14
|
+
_declarationBlockConfig = {};
|
|
15
|
+
_collectedResolvers = {};
|
|
16
|
+
_parsedSchemaMeta = {
|
|
17
|
+
types: {
|
|
18
|
+
interface: {},
|
|
19
|
+
union: {},
|
|
20
|
+
},
|
|
21
|
+
typesWithIsTypeOf: {},
|
|
22
|
+
};
|
|
23
|
+
_collectedDirectiveResolvers = {};
|
|
24
|
+
_variablesTransformer;
|
|
25
|
+
_usedMappers = {};
|
|
26
|
+
_resolversTypes = {};
|
|
27
|
+
_resolversParentTypes = {};
|
|
28
|
+
_hasReferencedResolversUnionTypes = false;
|
|
29
|
+
_hasReferencedResolversInterfaceTypes = false;
|
|
30
|
+
_resolversUnionTypes = {};
|
|
31
|
+
_resolversInterfaceTypes = {};
|
|
32
|
+
_rootTypeNames = new Set();
|
|
33
|
+
_globalDeclarations = new Set();
|
|
34
|
+
_federation;
|
|
35
|
+
_hasScalars = false;
|
|
36
|
+
_fieldContextTypeMap;
|
|
37
|
+
_directiveContextTypesMap;
|
|
38
|
+
_checkedTypesWithNestedAbstractTypes = {};
|
|
39
|
+
_directiveResolverMappings;
|
|
40
|
+
_shouldMapType = {};
|
|
13
41
|
constructor(rawConfig, additionalConfig, _schema, defaultScalars = DEFAULT_SCALARS, federationMeta = {}) {
|
|
14
42
|
super(rawConfig, {
|
|
15
43
|
immutableTypes: getConfigValue(rawConfig.immutableTypes, false),
|
|
@@ -43,28 +71,6 @@ export class BaseResolversVisitor extends BaseVisitor {
|
|
|
43
71
|
...additionalConfig,
|
|
44
72
|
});
|
|
45
73
|
this._schema = _schema;
|
|
46
|
-
this._declarationBlockConfig = {};
|
|
47
|
-
this._collectedResolvers = {};
|
|
48
|
-
this._parsedSchemaMeta = {
|
|
49
|
-
types: {
|
|
50
|
-
interface: {},
|
|
51
|
-
union: {},
|
|
52
|
-
},
|
|
53
|
-
typesWithIsTypeOf: {},
|
|
54
|
-
};
|
|
55
|
-
this._collectedDirectiveResolvers = {};
|
|
56
|
-
this._usedMappers = {};
|
|
57
|
-
this._resolversTypes = {};
|
|
58
|
-
this._resolversParentTypes = {};
|
|
59
|
-
this._hasReferencedResolversUnionTypes = false;
|
|
60
|
-
this._hasReferencedResolversInterfaceTypes = false;
|
|
61
|
-
this._resolversUnionTypes = {};
|
|
62
|
-
this._resolversInterfaceTypes = {};
|
|
63
|
-
this._rootTypeNames = new Set();
|
|
64
|
-
this._globalDeclarations = new Set();
|
|
65
|
-
this._hasScalars = false;
|
|
66
|
-
this._checkedTypesWithNestedAbstractTypes = {};
|
|
67
|
-
this._shouldMapType = {};
|
|
68
74
|
autoBind(this);
|
|
69
75
|
this._federation = new ApolloFederation({
|
|
70
76
|
enabled: this.config.federation,
|
|
@@ -7,6 +7,8 @@ import { DEFAULT_SCALARS } from './scalars.js';
|
|
|
7
7
|
import { buildScalarsFromConfig, DeclarationBlock, getConfigValue, indent, isOneOfInputObjectType, transformComment, wrapWithSingleQuotes, } from './utils.js';
|
|
8
8
|
import { OperationVariablesToObject } from './variables-to-object.js';
|
|
9
9
|
export class BaseTypesVisitor extends BaseVisitor {
|
|
10
|
+
_schema;
|
|
11
|
+
_argumentsTransformer;
|
|
10
12
|
constructor(_schema, rawConfig, additionalConfig, defaultScalars = DEFAULT_SCALARS) {
|
|
11
13
|
super(rawConfig, {
|
|
12
14
|
enumPrefix: getConfigValue(rawConfig.enumPrefix, true),
|
package/esm/base-visitor.js
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import autoBind from 'auto-bind';
|
|
2
2
|
import { convertFactory } from './naming.js';
|
|
3
3
|
export class BaseVisitor {
|
|
4
|
+
_parsedConfig;
|
|
5
|
+
_declarationBlockConfig = {};
|
|
6
|
+
scalars;
|
|
4
7
|
constructor(rawConfig, additionalConfig) {
|
|
5
|
-
this._declarationBlockConfig = {};
|
|
6
8
|
this._parsedConfig = {
|
|
7
9
|
convert: convertFactory(rawConfig),
|
|
8
10
|
typesPrefix: rawConfig.typesPrefix || '',
|
|
@@ -20,6 +20,15 @@ export var DocumentMode;
|
|
|
20
20
|
})(DocumentMode || (DocumentMode = {}));
|
|
21
21
|
const EXTENSIONS_TO_REMOVE = ['.ts', '.tsx', '.js', '.jsx'];
|
|
22
22
|
export class ClientSideBaseVisitor extends BaseVisitor {
|
|
23
|
+
_schema;
|
|
24
|
+
_collectedOperations = [];
|
|
25
|
+
_documents = [];
|
|
26
|
+
_additionalImports = [];
|
|
27
|
+
_imports = new Set();
|
|
28
|
+
_onExecutableDocumentNode;
|
|
29
|
+
_omitDefinitions;
|
|
30
|
+
_fragments;
|
|
31
|
+
fragmentsGraph;
|
|
23
32
|
constructor(_schema, fragments, rawConfig, additionalConfig, documents) {
|
|
24
33
|
super(rawConfig, {
|
|
25
34
|
scalars: buildScalarsFromConfig(_schema, rawConfig),
|
|
@@ -47,10 +56,6 @@ export class ClientSideBaseVisitor extends BaseVisitor {
|
|
|
47
56
|
...additionalConfig,
|
|
48
57
|
});
|
|
49
58
|
this._schema = _schema;
|
|
50
|
-
this._collectedOperations = [];
|
|
51
|
-
this._documents = [];
|
|
52
|
-
this._additionalImports = [];
|
|
53
|
-
this._imports = new Set();
|
|
54
59
|
this._documents = documents;
|
|
55
60
|
this._onExecutableDocumentNode = rawConfig.unstable_onExecutableDocumentNode;
|
|
56
61
|
this._omitDefinitions = rawConfig.unstable_omitDefinitions;
|
|
@@ -13,6 +13,19 @@ const metadataFieldMap = {
|
|
|
13
13
|
__type: TypeMetaFieldDef,
|
|
14
14
|
};
|
|
15
15
|
export class SelectionSetToObject {
|
|
16
|
+
_processor;
|
|
17
|
+
_scalars;
|
|
18
|
+
_schema;
|
|
19
|
+
_convertName;
|
|
20
|
+
_getFragmentSuffix;
|
|
21
|
+
_loadedFragments;
|
|
22
|
+
_config;
|
|
23
|
+
_parentSchemaType;
|
|
24
|
+
_selectionSet;
|
|
25
|
+
_primitiveFields = [];
|
|
26
|
+
_primitiveAliasedFields = [];
|
|
27
|
+
_linksFields = [];
|
|
28
|
+
_queriedForTypename = false;
|
|
16
29
|
constructor(_processor, _scalars, _schema, _convertName, _getFragmentSuffix, _loadedFragments, _config, _parentSchemaType, _selectionSet) {
|
|
17
30
|
this._processor = _processor;
|
|
18
31
|
this._scalars = _scalars;
|
|
@@ -23,10 +36,6 @@ export class SelectionSetToObject {
|
|
|
23
36
|
this._config = _config;
|
|
24
37
|
this._parentSchemaType = _parentSchemaType;
|
|
25
38
|
this._selectionSet = _selectionSet;
|
|
26
|
-
this._primitiveFields = [];
|
|
27
|
-
this._primitiveAliasedFields = [];
|
|
28
|
-
this._linksFields = [];
|
|
29
|
-
this._queriedForTypename = false;
|
|
30
39
|
autoBind(this);
|
|
31
40
|
}
|
|
32
41
|
createNext(parentSchemaType, selectionSet) {
|
package/esm/utils.js
CHANGED
|
@@ -59,18 +59,19 @@ export function transformComment(comment, indentLevel = 0, disabled = false) {
|
|
|
59
59
|
return stripTrailingSpaces(lines.map(line => indent(line, indentLevel)).join('\n'));
|
|
60
60
|
}
|
|
61
61
|
export class DeclarationBlock {
|
|
62
|
+
_config;
|
|
63
|
+
_decorator = null;
|
|
64
|
+
_export = false;
|
|
65
|
+
_name = null;
|
|
66
|
+
_kind = null;
|
|
67
|
+
_methodName = null;
|
|
68
|
+
_content = null;
|
|
69
|
+
_block = null;
|
|
70
|
+
_nameGenerics = null;
|
|
71
|
+
_comment = null;
|
|
72
|
+
_ignoreBlockWrapper = false;
|
|
62
73
|
constructor(_config) {
|
|
63
74
|
this._config = _config;
|
|
64
|
-
this._decorator = null;
|
|
65
|
-
this._export = false;
|
|
66
|
-
this._name = null;
|
|
67
|
-
this._kind = null;
|
|
68
|
-
this._methodName = null;
|
|
69
|
-
this._content = null;
|
|
70
|
-
this._block = null;
|
|
71
|
-
this._nameGenerics = null;
|
|
72
|
-
this._comment = null;
|
|
73
|
-
this._ignoreBlockWrapper = false;
|
|
74
75
|
this._config = {
|
|
75
76
|
blockWrapper: '',
|
|
76
77
|
blockTransformer: block => block,
|
|
@@ -2,6 +2,15 @@ import autoBind from 'auto-bind';
|
|
|
2
2
|
import { Kind } from 'graphql';
|
|
3
3
|
import { getBaseTypeNode, indent } from './utils.js';
|
|
4
4
|
export class OperationVariablesToObject {
|
|
5
|
+
_scalars;
|
|
6
|
+
_convertName;
|
|
7
|
+
_namespacedImportName;
|
|
8
|
+
_enumNames;
|
|
9
|
+
_enumPrefix;
|
|
10
|
+
_enumSuffix;
|
|
11
|
+
_enumValues;
|
|
12
|
+
_applyCoercion;
|
|
13
|
+
_directiveArgumentAndInputFieldMappings;
|
|
5
14
|
constructor(_scalars, _convertName, _namespacedImportName = null, _enumNames = [], _enumPrefix = true, _enumSuffix = true, _enumValues = {}, _applyCoercion = false, _directiveArgumentAndInputFieldMappings = {}) {
|
|
6
15
|
this._scalars = _scalars;
|
|
7
16
|
this._convertName = _convertName;
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@graphql-codegen/visitor-plugin-common",
|
|
3
|
-
"version": "6.0.0-alpha-
|
|
3
|
+
"version": "6.0.0-alpha-20250813125320-63ac348b428178b17ad9fae069ce727ffddb8744",
|
|
4
4
|
"peerDependencies": {
|
|
5
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"
|
|
6
6
|
},
|
|
7
7
|
"dependencies": {
|
|
8
8
|
"@graphql-tools/optimize": "^2.0.0",
|
|
9
|
-
"@graphql-codegen/plugin-helpers": "6.0.0-alpha-
|
|
9
|
+
"@graphql-codegen/plugin-helpers": "6.0.0-alpha-20250813125320-63ac348b428178b17ad9fae069ce727ffddb8744",
|
|
10
10
|
"@graphql-tools/relay-operation-optimizer": "^7.0.0",
|
|
11
11
|
"@graphql-tools/utils": "^10.0.0",
|
|
12
12
|
"auto-bind": "~4.0.0",
|