@graphql-codegen/visitor-plugin-common 7.2.7 → 7.2.8-alpha-20260929230333-3a889d8d80c55082af4a032f1a20829783f3be82

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/utils.js CHANGED
@@ -126,7 +126,7 @@ class DeclarationBlock {
126
126
  }
127
127
  withComment(comment, disabled = false) {
128
128
  const nonEmptyComment = !!(isStringValueNode(comment) ? comment.value : comment);
129
- if (nonEmptyComment && !disabled) {
129
+ if (comment && nonEmptyComment && !disabled) {
130
130
  this._comment = transformComment(comment, 0);
131
131
  }
132
132
  return this;
package/esm/utils.js CHANGED
@@ -97,7 +97,7 @@ export class DeclarationBlock {
97
97
  }
98
98
  withComment(comment, disabled = false) {
99
99
  const nonEmptyComment = !!(isStringValueNode(comment) ? comment.value : comment);
100
- if (nonEmptyComment && !disabled) {
100
+ if (comment && nonEmptyComment && !disabled) {
101
101
  this._comment = transformComment(comment, 0);
102
102
  }
103
103
  return this;
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@graphql-codegen/visitor-plugin-common",
3
- "version": "7.2.7",
3
+ "version": "7.2.8-alpha-20260929230333-3a889d8d80c55082af4a032f1a20829783f3be82",
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 || ^17.0.0"
6
6
  },
7
7
  "dependencies": {
8
- "@graphql-codegen/plugin-helpers": "^7.4.0",
8
+ "@graphql-codegen/plugin-helpers": "^7.4.1-alpha-20260929230333-3a889d8d80c55082af4a032f1a20829783f3be82",
9
9
  "@graphql-tools/optimize": "^2.0.0",
10
10
  "@graphql-tools/relay-operation-optimizer": "^7.1.1",
11
11
  "@graphql-tools/utils": "^11.2.0",
@@ -2,7 +2,7 @@ import { GraphQLSchema } from 'graphql';
2
2
  import type { ConvertFn, EnumValuesMap, ParsedEnumValuesMap } from './types.cjs';
3
3
  export declare function parseEnumValues({ schema, mapOrStr, ignoreEnumValuesFromSchema, naming, }: {
4
4
  schema: GraphQLSchema;
5
- mapOrStr: EnumValuesMap;
5
+ mapOrStr?: EnumValuesMap;
6
6
  ignoreEnumValuesFromSchema?: boolean;
7
7
  naming: {
8
8
  convert: ConvertFn;
@@ -2,7 +2,7 @@ import { GraphQLSchema } from 'graphql';
2
2
  import type { ConvertFn, EnumValuesMap, ParsedEnumValuesMap } from './types.js';
3
3
  export declare function parseEnumValues({ schema, mapOrStr, ignoreEnumValuesFromSchema, naming, }: {
4
4
  schema: GraphQLSchema;
5
- mapOrStr: EnumValuesMap;
5
+ mapOrStr?: EnumValuesMap;
6
6
  ignoreEnumValuesFromSchema?: boolean;
7
7
  naming: {
8
8
  convert: ConvertFn;
@@ -16,7 +16,7 @@ export type ImportSource<T = string> = {
16
16
  /**
17
17
  * Namespace to import source as
18
18
  */
19
- namespace?: string;
19
+ namespace?: string | null;
20
20
  /**
21
21
  * Entity names to import
22
22
  */
@@ -16,7 +16,7 @@ export type ImportSource<T = string> = {
16
16
  /**
17
17
  * Namespace to import source as
18
18
  */
19
- namespace?: string;
19
+ namespace?: string | null;
20
20
  /**
21
21
  * Entity names to import
22
22
  */
@@ -1,5 +1,5 @@
1
1
  import { GraphQLSchema } from 'graphql';
2
2
  import { Types } from '@graphql-codegen/plugin-helpers';
3
3
  export declare function optimizeOperations(schema: GraphQLSchema, documents: Types.DocumentFile[], options?: {
4
- includeFragments: boolean;
4
+ includeFragments?: boolean;
5
5
  }): Types.DocumentFile[];
@@ -1,5 +1,5 @@
1
1
  import { GraphQLSchema } from 'graphql';
2
2
  import { Types } from '@graphql-codegen/plugin-helpers';
3
3
  export declare function optimizeOperations(schema: GraphQLSchema, documents: Types.DocumentFile[], options?: {
4
- includeFragments: boolean;
4
+ includeFragments?: boolean;
5
5
  }): Types.DocumentFile[];
@@ -26,13 +26,13 @@ export declare class DeclarationBlock {
26
26
  _content: any;
27
27
  _block: any;
28
28
  _nameGenerics: any;
29
- _comment: any;
29
+ _comment: string | null;
30
30
  _ignoreBlockWrapper: boolean;
31
31
  constructor(_config: DeclarationBlockConfig);
32
32
  withDecorator(decorator: string): DeclarationBlock;
33
33
  export(exp?: boolean): DeclarationBlock;
34
34
  asKind(kind: string): DeclarationBlock;
35
- withComment(comment: string | StringValueNode | null, disabled?: boolean): DeclarationBlock;
35
+ withComment(comment: string | StringValueNode | null | undefined, disabled?: boolean): DeclarationBlock;
36
36
  withMethodCall(methodName: string, ignoreBlockWrapper?: boolean): DeclarationBlock;
37
37
  withBlock(block: string): DeclarationBlock;
38
38
  withContent(content: string): DeclarationBlock;
@@ -26,13 +26,13 @@ export declare class DeclarationBlock {
26
26
  _content: any;
27
27
  _block: any;
28
28
  _nameGenerics: any;
29
- _comment: any;
29
+ _comment: string | null;
30
30
  _ignoreBlockWrapper: boolean;
31
31
  constructor(_config: DeclarationBlockConfig);
32
32
  withDecorator(decorator: string): DeclarationBlock;
33
33
  export(exp?: boolean): DeclarationBlock;
34
34
  asKind(kind: string): DeclarationBlock;
35
- withComment(comment: string | StringValueNode | null, disabled?: boolean): DeclarationBlock;
35
+ withComment(comment: string | StringValueNode | null | undefined, disabled?: boolean): DeclarationBlock;
36
36
  withMethodCall(methodName: string, ignoreBlockWrapper?: boolean): DeclarationBlock;
37
37
  withBlock(block: string): DeclarationBlock;
38
38
  withContent(content: string): DeclarationBlock;