|
1 | 1 | # @graphql-codegen/visitor-plugin-common |
2 | 2 |
|
| 3 | +## 7.2.10 |
| 4 | + |
| 5 | +### Patch Changes |
| 6 | + |
| 7 | +- [#10985](https://github.com/dotansimha/graphql-code-generator/pull/10985) |
| 8 | + [`d8aa07f`](https://github.com/dotansimha/graphql-code-generator/commit/d8aa07fed45a2787f46da30a7ffb52651b32dc67) |
| 9 | + Thanks [@eddeee888](https://github.com/eddeee888)! - Build with `strict: true`, which changes |
| 10 | + these emitted type declarations: |
| 11 | + - `@graphql-codegen/cli`: `mkdirp` returns `Promise<string | undefined>`, and the `require` (`-r`) |
| 12 | + CLI option's `default` is typed `never[]` instead of `any[]`. |
| 13 | + - `@graphql-codegen/visitor-plugin-common`: `BaseResolversVisitor` and `BaseTypesVisitor` |
| 14 | + `SchemaDefinition()`/`SchemaExtension()` return `null` instead of `any`. |
| 15 | + - `@graphql-codegen/visitor-plugin-common`: `BaseSelectionSetProcessor.typeCache` is keyed by |
| 16 | + `Location | undefined`. |
| 17 | + - `@graphql-codegen/visitor-plugin-common`: `SelectionSetToObject.buildSelectionSet` returns |
| 18 | + `typeInfo` as `{ name: string; type: string } | null`. |
| 19 | + - `@graphql-codegen/visitor-plugin-common`: `getPossibleTypes` accepts `null` as the type, which |
| 20 | + graphql 15's `schema.getType()` can return. |
| 21 | + - `@graphql-codegen/visitor-plugin-common`: `removeDescription` returns nodes with |
| 22 | + `description: undefined` instead of `any`. |
| 23 | + - `@graphql-codegen/typescript`: `TsIntrospectionVisitor`'s constructor takes `pluginConfig` as |
| 24 | + `TypeScriptPluginConfig | undefined`, `DirectiveDefinition()` returns `null` and |
| 25 | + `ObjectTypeDefinition()` returns `string | null`. |
| 26 | + - `@graphql-codegen/client-preset`: the babel preset accepts `options` as |
| 27 | + `ClientBabelPresetOptions | null | undefined`. |
| 28 | + - `@graphql-codegen/testing`: `mockGraphQLServer` returns `nock.Scope | null`. |
| 29 | + - `@graphql-codegen/graphql-modules-preset`: a schema without `extensions` (graphql 15) throws the |
| 30 | + "requires to use GraphQL SDL" error instead of a `TypeError`. |
| 31 | + |
| 32 | + Generated output is unchanged. |
| 33 | + |
| 34 | +- [#11039](https://github.com/dotansimha/graphql-code-generator/pull/11039) |
| 35 | + [`5078faf`](https://github.com/dotansimha/graphql-code-generator/commit/5078faf7ba4cef1c7164ce0b9d6fc01af56a5497) |
| 36 | + Thanks [@eddeee888](https://github.com/eddeee888)! - Fix type errors in `visitor-plugin-common` |
| 37 | + (`utils`, `imports`, `naming`, `mappers`, `types`, `variables-to-object`, |
| 38 | + `convert-schema-enum-to-declaration-block-string`, `selection-set-processor/base` and |
| 39 | + `optimize-operations`) under `strict: true`: |
| 40 | + - `transformComment` accepts `undefined` and `null`, which it already handles by returning an |
| 41 | + empty string. |
| 42 | + - `block` declares its param as `string[] | null | undefined`, which it already handles by |
| 43 | + returning an empty string. |
| 44 | + - `DeclarationBlock`'s fields are typed as `string | null` (`_name` as |
| 45 | + `string | NameNode | null`), and `withBlock` accepts `null`, which renders the same as no block. |
| 46 | + - `DeclarationBlock` falls back to returning the block unchanged when `blockTransformer` is passed |
| 47 | + as `undefined`, instead of throwing. |
| 48 | + - `buildScalars` accepts an `undefined` scalars mapping, which it already handles by using only |
| 49 | + the defaults and the schema. |
| 50 | + - `buildTypeImport` accepts a nullish `identifier` and `source`, and throws a descriptive error |
| 51 | + when either is missing. |
| 52 | + - `ParsedEnumValuesMap`'s `mappedValues`, `sourceIdentifier`, `sourceFile` and `importIdentifier` |
| 53 | + accept `null`, which `parseEnumValues` already emits. |
| 54 | + - `transformMappers` defaults `rawMappers` to `{}`. |
| 55 | + - `OperationVariablesToObject.getName`, `OperationVariablesToObject.transform` and |
| 56 | + `BaseSelectionSetProcessor.buildSelectionSetFromStrings` may return `null`, which they already |
| 57 | + return. |
| 58 | + - `buildEnumValuesBlock` throws a descriptive error when an enum value is not defined on the |
| 59 | + schema's enum. |
| 60 | + - `optimizeOperations` throws a descriptive error when a document file has no parsed document. |
| 61 | + - `unique`'s default key uses `String(item)`. |
| 62 | + - `convertSchemaEnumToDeclarationBlockString` treats an enum node without `values` as empty |
| 63 | + instead of throwing. |
| 64 | + - `generateFragmentImportStatement` treats a missing `identifiers` as empty. |
| 65 | + - `getDeprecationReason` returns the default reason for a `@deprecated` directive without |
| 66 | + arguments. |
| 67 | + - `isOneOfInputObjectType` returns `false` instead of `undefined`. |
| 68 | + - `buildEnumValuesBlock` treats a non-enum schema type with the enum's name as having no schema |
| 69 | + enum. |
| 70 | + - `OperationVariablesToObject` emits `''` instead of the text `undefined`/`null` when a variable |
| 71 | + has no name or no type identifier. |
| 72 | + |
| 73 | + Generated output is unchanged, except in the cases above. |
| 74 | + |
3 | 75 | ## 7.2.9 |
4 | 76 |
|
5 | 77 | ### Patch Changes |
|
0 commit comments