@graphql-codegen/visitor-plugin-common 5.8.0-alpha-20250320115712-0c95c1869f1781093936579f0f8ebc1091082c5c → 5.8.0-alpha-20250320120627-eeef9e47372acd1e10d1ac7bd38d21ae7f65d817
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.
|
@@ -47,9 +47,6 @@ class BaseResolversVisitor extends base_visitor_js_1.BaseVisitor {
|
|
|
47
47
|
},
|
|
48
48
|
resolversNonOptionalTypename: normalizeResolversNonOptionalTypename((0, utils_js_1.getConfigValue)(rawConfig.resolversNonOptionalTypename, false)),
|
|
49
49
|
avoidCheckingAbstractTypesRecursively: (0, utils_js_1.getConfigValue)(rawConfig.avoidCheckingAbstractTypesRecursively, false),
|
|
50
|
-
customDirectives: {
|
|
51
|
-
semanticNonNull: rawConfig.customDirectives?.semanticNonNull ?? false,
|
|
52
|
-
},
|
|
53
50
|
...additionalConfig,
|
|
54
51
|
});
|
|
55
52
|
this._schema = _schema;
|
|
@@ -719,12 +716,6 @@ class BaseResolversVisitor extends base_visitor_js_1.BaseVisitor {
|
|
|
719
716
|
applyOptionalFields(argsType, _fields) {
|
|
720
717
|
return `Partial<${argsType}>`;
|
|
721
718
|
}
|
|
722
|
-
clearOptional(str) {
|
|
723
|
-
if (str.startsWith('Maybe')) {
|
|
724
|
-
return str.replace(/Maybe<(.*?)>$/, '$1');
|
|
725
|
-
}
|
|
726
|
-
return str;
|
|
727
|
-
}
|
|
728
719
|
ObjectTypeDefinition(node) {
|
|
729
720
|
const declarationKind = 'type';
|
|
730
721
|
const name = this.convertName(node, {
|
|
@@ -43,9 +43,6 @@ export class BaseResolversVisitor extends BaseVisitor {
|
|
|
43
43
|
},
|
|
44
44
|
resolversNonOptionalTypename: normalizeResolversNonOptionalTypename(getConfigValue(rawConfig.resolversNonOptionalTypename, false)),
|
|
45
45
|
avoidCheckingAbstractTypesRecursively: getConfigValue(rawConfig.avoidCheckingAbstractTypesRecursively, false),
|
|
46
|
-
customDirectives: {
|
|
47
|
-
semanticNonNull: rawConfig.customDirectives?.semanticNonNull ?? false,
|
|
48
|
-
},
|
|
49
46
|
...additionalConfig,
|
|
50
47
|
});
|
|
51
48
|
this._schema = _schema;
|
|
@@ -715,12 +712,6 @@ export class BaseResolversVisitor extends BaseVisitor {
|
|
|
715
712
|
applyOptionalFields(argsType, _fields) {
|
|
716
713
|
return `Partial<${argsType}>`;
|
|
717
714
|
}
|
|
718
|
-
clearOptional(str) {
|
|
719
|
-
if (str.startsWith('Maybe')) {
|
|
720
|
-
return str.replace(/Maybe<(.*?)>$/, '$1');
|
|
721
|
-
}
|
|
722
|
-
return str;
|
|
723
|
-
}
|
|
724
715
|
ObjectTypeDefinition(node) {
|
|
725
716
|
const declarationKind = 'type';
|
|
726
717
|
const name = this.convertName(node, {
|
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-20250320120627-eeef9e47372acd1e10d1ac7bd38d21ae7f65d817",
|
|
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
|
},
|
|
@@ -32,9 +32,6 @@ export interface ParsedResolversConfig extends ParsedConfig {
|
|
|
32
32
|
directiveResolverMappings: Record<string, string>;
|
|
33
33
|
resolversNonOptionalTypename: ResolversNonOptionalTypenameConfig;
|
|
34
34
|
avoidCheckingAbstractTypesRecursively: boolean;
|
|
35
|
-
customDirectives: {
|
|
36
|
-
semanticNonNull: boolean;
|
|
37
|
-
};
|
|
38
35
|
}
|
|
39
36
|
type FieldDefinitionPrintFn = (parentName: string, avoidResolverOptionals: boolean) => string | null;
|
|
40
37
|
export interface RootResolver {
|
|
@@ -511,6 +508,14 @@ export interface RawResolversConfig extends RawConfig {
|
|
|
511
508
|
/**
|
|
512
509
|
* @description Configures behavior for custom directives from various GraphQL libraries.
|
|
513
510
|
* @exampleMarkdown
|
|
511
|
+
* First, install `graphql-sock` peer dependency:
|
|
512
|
+
*
|
|
513
|
+
* ```
|
|
514
|
+
* npm install --save-dev graphql-sock
|
|
515
|
+
* ```
|
|
516
|
+
*
|
|
517
|
+
* Now, you can turn on support for `@semanticNonNull` directive:
|
|
518
|
+
*
|
|
514
519
|
* ```ts filename="codegen.ts"
|
|
515
520
|
* import type { CodegenConfig } from '@graphql-codegen/cli';
|
|
516
521
|
*
|
|
@@ -749,7 +754,6 @@ export declare class BaseResolversVisitor<TRawConfig extends RawResolversConfig
|
|
|
749
754
|
private getContextType;
|
|
750
755
|
protected applyRequireFields(argsType: string, fields: InputValueDefinitionNode[]): string;
|
|
751
756
|
protected applyOptionalFields(argsType: string, _fields: readonly InputValueDefinitionNode[]): string;
|
|
752
|
-
protected clearOptional(str: string): string;
|
|
753
757
|
ObjectTypeDefinition(node: ObjectTypeDefinitionNode): string;
|
|
754
758
|
UnionTypeDefinition(node: UnionTypeDefinitionNode, key: string | number, parent: any): string;
|
|
755
759
|
ScalarTypeDefinition(node: ScalarTypeDefinitionNode): string;
|
|
@@ -32,9 +32,6 @@ export interface ParsedResolversConfig extends ParsedConfig {
|
|
|
32
32
|
directiveResolverMappings: Record<string, string>;
|
|
33
33
|
resolversNonOptionalTypename: ResolversNonOptionalTypenameConfig;
|
|
34
34
|
avoidCheckingAbstractTypesRecursively: boolean;
|
|
35
|
-
customDirectives: {
|
|
36
|
-
semanticNonNull: boolean;
|
|
37
|
-
};
|
|
38
35
|
}
|
|
39
36
|
type FieldDefinitionPrintFn = (parentName: string, avoidResolverOptionals: boolean) => string | null;
|
|
40
37
|
export interface RootResolver {
|
|
@@ -511,6 +508,14 @@ export interface RawResolversConfig extends RawConfig {
|
|
|
511
508
|
/**
|
|
512
509
|
* @description Configures behavior for custom directives from various GraphQL libraries.
|
|
513
510
|
* @exampleMarkdown
|
|
511
|
+
* First, install `graphql-sock` peer dependency:
|
|
512
|
+
*
|
|
513
|
+
* ```
|
|
514
|
+
* npm install --save-dev graphql-sock
|
|
515
|
+
* ```
|
|
516
|
+
*
|
|
517
|
+
* Now, you can turn on support for `@semanticNonNull` directive:
|
|
518
|
+
*
|
|
514
519
|
* ```ts filename="codegen.ts"
|
|
515
520
|
* import type { CodegenConfig } from '@graphql-codegen/cli';
|
|
516
521
|
*
|
|
@@ -749,7 +754,6 @@ export declare class BaseResolversVisitor<TRawConfig extends RawResolversConfig
|
|
|
749
754
|
private getContextType;
|
|
750
755
|
protected applyRequireFields(argsType: string, fields: InputValueDefinitionNode[]): string;
|
|
751
756
|
protected applyOptionalFields(argsType: string, _fields: readonly InputValueDefinitionNode[]): string;
|
|
752
|
-
protected clearOptional(str: string): string;
|
|
753
757
|
ObjectTypeDefinition(node: ObjectTypeDefinitionNode): string;
|
|
754
758
|
UnionTypeDefinition(node: UnionTypeDefinitionNode, key: string | number, parent: any): string;
|
|
755
759
|
ScalarTypeDefinition(node: ScalarTypeDefinitionNode): string;
|