@graphql-codegen/visitor-plugin-common 6.0.0-alpha-20250609130245-016484a10b6d41d848d7b0967ce8929c5b0ccdc8 → 6.0.0-alpha-20250609132459-7295defb943748833086d045631267fb86a57303
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.
|
@@ -96,8 +96,7 @@ class BaseResolversVisitor extends base_visitor_js_1.BaseVisitor {
|
|
|
96
96
|
shouldInclude: namedType => !(0, graphql_1.isEnumType)(namedType),
|
|
97
97
|
onNotMappedObjectType: ({ typeName, initialType }) => {
|
|
98
98
|
let result = initialType;
|
|
99
|
-
|
|
100
|
-
if (referenceSelectionSetsString) {
|
|
99
|
+
if (this._federation.getMeta()[typeName]?.referenceSelectionSetsString) {
|
|
101
100
|
result += ` | ${this.convertName('FederationReferenceTypes')}['${typeName}']`;
|
|
102
101
|
}
|
|
103
102
|
return result;
|
|
@@ -744,6 +743,7 @@ class BaseResolversVisitor extends base_visitor_js_1.BaseVisitor {
|
|
|
744
743
|
const referenceType = 'FederationReferenceType';
|
|
745
744
|
signature.type = 'ReferenceResolver';
|
|
746
745
|
signature.genericTypes = [resultType, referenceType, contextType];
|
|
746
|
+
meta.federation = { isResolveReference: true };
|
|
747
747
|
}
|
|
748
748
|
return {
|
|
749
749
|
value: (0, utils_js_1.indent)(`${signature.name}${signature.modifier}: ${signature.type}<${signature.genericTypes.join(', ')}>${this.getPunctuation(declarationKind)}`),
|
|
@@ -92,8 +92,7 @@ export class BaseResolversVisitor extends BaseVisitor {
|
|
|
92
92
|
shouldInclude: namedType => !isEnumType(namedType),
|
|
93
93
|
onNotMappedObjectType: ({ typeName, initialType }) => {
|
|
94
94
|
let result = initialType;
|
|
95
|
-
|
|
96
|
-
if (referenceSelectionSetsString) {
|
|
95
|
+
if (this._federation.getMeta()[typeName]?.referenceSelectionSetsString) {
|
|
97
96
|
result += ` | ${this.convertName('FederationReferenceTypes')}['${typeName}']`;
|
|
98
97
|
}
|
|
99
98
|
return result;
|
|
@@ -740,6 +739,7 @@ export class BaseResolversVisitor extends BaseVisitor {
|
|
|
740
739
|
const referenceType = 'FederationReferenceType';
|
|
741
740
|
signature.type = 'ReferenceResolver';
|
|
742
741
|
signature.genericTypes = [resultType, referenceType, contextType];
|
|
742
|
+
meta.federation = { isResolveReference: true };
|
|
743
743
|
}
|
|
744
744
|
return {
|
|
745
745
|
value: indent(`${signature.name}${signature.modifier}: ${signature.type}<${signature.genericTypes.join(', ')}>${this.getPunctuation(declarationKind)}`),
|
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-20250609132459-7295defb943748833086d045631267fb86a57303",
|
|
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-20250609132459-7295defb943748833086d045631267fb86a57303",
|
|
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",
|