@graphql-codegen/visitor-plugin-common 5.8.0-alpha-20250316110831-3f757aba5365f95cb2ea64e6f2e73cd4ddd534a2 → 5.8.0-alpha-20250320115712-0c95c1869f1781093936579f0f8ebc1091082c5c
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.
|
@@ -669,7 +669,7 @@ class BaseResolversVisitor extends base_visitor_js_1.BaseVisitor {
|
|
|
669
669
|
.filter(Boolean)
|
|
670
670
|
.reverse() ?? [];
|
|
671
671
|
return {
|
|
672
|
-
mappedTypeKey:
|
|
672
|
+
mappedTypeKey: mappedType,
|
|
673
673
|
resolverType: directiveMappings[0] ?? 'Resolver',
|
|
674
674
|
};
|
|
675
675
|
})();
|
|
@@ -719,20 +719,6 @@ class BaseResolversVisitor extends base_visitor_js_1.BaseVisitor {
|
|
|
719
719
|
applyOptionalFields(argsType, _fields) {
|
|
720
720
|
return `Partial<${argsType}>`;
|
|
721
721
|
}
|
|
722
|
-
/**
|
|
723
|
-
* Function to apply extra transformation to a FieldDefinitionNode's TypeScript type based on config options
|
|
724
|
-
* e.g. takes `Maybe<ResolversTypes['String']>`, and returns the type without the `Maybe<>` wrapper.
|
|
725
|
-
*/
|
|
726
|
-
modifyFieldDefinitionNodeTransformedType({ node, originalType, }) {
|
|
727
|
-
let result = originalType;
|
|
728
|
-
if (this.config.customDirectives.semanticNonNull) {
|
|
729
|
-
const fieldHasSemanticNonNull = node.directives.some(d => d.name.value === 'semanticNonNull');
|
|
730
|
-
if (fieldHasSemanticNonNull) {
|
|
731
|
-
result = this.clearOptional(result);
|
|
732
|
-
}
|
|
733
|
-
}
|
|
734
|
-
return result;
|
|
735
|
-
}
|
|
736
722
|
clearOptional(str) {
|
|
737
723
|
if (str.startsWith('Maybe')) {
|
|
738
724
|
return str.replace(/Maybe<(.*?)>$/, '$1');
|
|
@@ -665,7 +665,7 @@ export class BaseResolversVisitor extends BaseVisitor {
|
|
|
665
665
|
.filter(Boolean)
|
|
666
666
|
.reverse() ?? [];
|
|
667
667
|
return {
|
|
668
|
-
mappedTypeKey:
|
|
668
|
+
mappedTypeKey: mappedType,
|
|
669
669
|
resolverType: directiveMappings[0] ?? 'Resolver',
|
|
670
670
|
};
|
|
671
671
|
})();
|
|
@@ -715,20 +715,6 @@ export class BaseResolversVisitor extends BaseVisitor {
|
|
|
715
715
|
applyOptionalFields(argsType, _fields) {
|
|
716
716
|
return `Partial<${argsType}>`;
|
|
717
717
|
}
|
|
718
|
-
/**
|
|
719
|
-
* Function to apply extra transformation to a FieldDefinitionNode's TypeScript type based on config options
|
|
720
|
-
* e.g. takes `Maybe<ResolversTypes['String']>`, and returns the type without the `Maybe<>` wrapper.
|
|
721
|
-
*/
|
|
722
|
-
modifyFieldDefinitionNodeTransformedType({ node, originalType, }) {
|
|
723
|
-
let result = originalType;
|
|
724
|
-
if (this.config.customDirectives.semanticNonNull) {
|
|
725
|
-
const fieldHasSemanticNonNull = node.directives.some(d => d.name.value === 'semanticNonNull');
|
|
726
|
-
if (fieldHasSemanticNonNull) {
|
|
727
|
-
result = this.clearOptional(result);
|
|
728
|
-
}
|
|
729
|
-
}
|
|
730
|
-
return result;
|
|
731
|
-
}
|
|
732
718
|
clearOptional(str) {
|
|
733
719
|
if (str.startsWith('Maybe')) {
|
|
734
720
|
return str.replace(/Maybe<(.*?)>$/, '$1');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@graphql-codegen/visitor-plugin-common",
|
|
3
|
-
"version": "5.8.0-alpha-
|
|
3
|
+
"version": "5.8.0-alpha-20250320115712-0c95c1869f1781093936579f0f8ebc1091082c5c",
|
|
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
|
},
|
|
@@ -749,14 +749,6 @@ export declare class BaseResolversVisitor<TRawConfig extends RawResolversConfig
|
|
|
749
749
|
private getContextType;
|
|
750
750
|
protected applyRequireFields(argsType: string, fields: InputValueDefinitionNode[]): string;
|
|
751
751
|
protected applyOptionalFields(argsType: string, _fields: readonly InputValueDefinitionNode[]): string;
|
|
752
|
-
/**
|
|
753
|
-
* Function to apply extra transformation to a FieldDefinitionNode's TypeScript type based on config options
|
|
754
|
-
* e.g. takes `Maybe<ResolversTypes['String']>`, and returns the type without the `Maybe<>` wrapper.
|
|
755
|
-
*/
|
|
756
|
-
protected modifyFieldDefinitionNodeTransformedType({ node, originalType, }: {
|
|
757
|
-
node: FieldDefinitionNode;
|
|
758
|
-
originalType: string;
|
|
759
|
-
}): string;
|
|
760
752
|
protected clearOptional(str: string): string;
|
|
761
753
|
ObjectTypeDefinition(node: ObjectTypeDefinitionNode): string;
|
|
762
754
|
UnionTypeDefinition(node: UnionTypeDefinitionNode, key: string | number, parent: any): string;
|
|
@@ -749,14 +749,6 @@ export declare class BaseResolversVisitor<TRawConfig extends RawResolversConfig
|
|
|
749
749
|
private getContextType;
|
|
750
750
|
protected applyRequireFields(argsType: string, fields: InputValueDefinitionNode[]): string;
|
|
751
751
|
protected applyOptionalFields(argsType: string, _fields: readonly InputValueDefinitionNode[]): string;
|
|
752
|
-
/**
|
|
753
|
-
* Function to apply extra transformation to a FieldDefinitionNode's TypeScript type based on config options
|
|
754
|
-
* e.g. takes `Maybe<ResolversTypes['String']>`, and returns the type without the `Maybe<>` wrapper.
|
|
755
|
-
*/
|
|
756
|
-
protected modifyFieldDefinitionNodeTransformedType({ node, originalType, }: {
|
|
757
|
-
node: FieldDefinitionNode;
|
|
758
|
-
originalType: string;
|
|
759
|
-
}): string;
|
|
760
752
|
protected clearOptional(str: string): string;
|
|
761
753
|
ObjectTypeDefinition(node: ObjectTypeDefinitionNode): string;
|
|
762
754
|
UnionTypeDefinition(node: UnionTypeDefinitionNode, key: string | number, parent: any): string;
|