From cac19e53e3acd30eb72571e39e4e0c314260c69c Mon Sep 17 00:00:00 2001 From: TheGuildBot <59414373+theguild-bot@users.noreply.github.com> Date: Thu, 13 Jun 2024 13:01:26 +0300 Subject: [PATCH] Upcoming Release Changes (#10000) Co-authored-by: github-actions[bot] --- .changeset/fresh-files-push.md | 19 --------- .changeset/polite-dancers-warn.md | 9 ----- .changeset/proud-cycles-design.md | 5 --- .changeset/spicy-starfishes-press.md | 29 ------------- packages/plugins/other/add/CHANGELOG.md | 10 +++++ packages/plugins/other/add/package.json | 2 +- packages/presets/client/CHANGELOG.md | 54 +++++++++++++++++++++++++ packages/presets/client/package.json | 4 +- website/package.json | 4 +- 9 files changed, 69 insertions(+), 67 deletions(-) delete mode 100644 .changeset/fresh-files-push.md delete mode 100644 .changeset/polite-dancers-warn.md delete mode 100644 .changeset/proud-cycles-design.md delete mode 100644 .changeset/spicy-starfishes-press.md diff --git a/.changeset/fresh-files-push.md b/.changeset/fresh-files-push.md deleted file mode 100644 index a5d24476789..00000000000 --- a/.changeset/fresh-files-push.md +++ /dev/null @@ -1,19 +0,0 @@ ---- -'@graphql-codegen/client-preset': minor ---- - -Support discriminating `null` and `undefined` within the `useFragment` function. - -```ts -function MyComponent(props: FragmentType | null) { - const data = useFragment(MyFragment, props) - // data is `MyFragment | null` -} - -function MyComponent(props: FragmentType | undefined) { - const data = useFragment(MyFragment, props) - // data is `MyFragment | undefined` -} -``` - -Before, the returned type from `useFragment` was always `TType | null | undefined`. diff --git a/.changeset/polite-dancers-warn.md b/.changeset/polite-dancers-warn.md deleted file mode 100644 index 6befc8e8e60..00000000000 --- a/.changeset/polite-dancers-warn.md +++ /dev/null @@ -1,9 +0,0 @@ ---- -'@graphql-codegen/add': patch ---- - -Export configuration types (e.g. `AddPluginConfig`) from the entry point. - -```ts -import type { AddPluginConfig } from '@graphql-codegen/add' -``` diff --git a/.changeset/proud-cycles-design.md b/.changeset/proud-cycles-design.md deleted file mode 100644 index bf6435d9e3a..00000000000 --- a/.changeset/proud-cycles-design.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@graphql-codegen/client-preset': minor ---- - -Preserving `Array` or `ReadonlyArray` in `useFragment()` return type. diff --git a/.changeset/spicy-starfishes-press.md b/.changeset/spicy-starfishes-press.md deleted file mode 100644 index b1c11f1c9d1..00000000000 --- a/.changeset/spicy-starfishes-press.md +++ /dev/null @@ -1,29 +0,0 @@ ---- -"@graphql-codegen/client-preset": patch ---- - -Added configuration to allow for custom hash functions for persisted documents in the client preset - -### Example -```ts filename="codegen.ts" {10-12} -import { type CodegenConfig } from '@graphql-codegen/cli' - -const config: CodegenConfig = { - schema: 'schema.graphql', - documents: ['src/**/*.tsx'], - generates: { - './src/gql/': { - preset: 'client', - presetConfig: { - persistedDocuments: { - hashAlgorithm: operation => { - const shasum = crypto.createHash('sha512') - shasum.update(operation) - return shasum.digest('hex') - } - } - } - } - } -} -``` diff --git a/packages/plugins/other/add/CHANGELOG.md b/packages/plugins/other/add/CHANGELOG.md index 84461ab9483..9c840d22e4a 100644 --- a/packages/plugins/other/add/CHANGELOG.md +++ b/packages/plugins/other/add/CHANGELOG.md @@ -1,5 +1,15 @@ # @graphql-codegen/add +## 5.0.3 + +### Patch Changes + +- [#9987](https://github.com/dotansimha/graphql-code-generator/pull/9987) [`5501c62`](https://github.com/dotansimha/graphql-code-generator/commit/5501c621f19eb5ef8e703a21f7367e07e41f199c) Thanks [@taro-28](https://github.com/taro-28)! - Export configuration types (e.g. `AddPluginConfig`) from the entry point. + + ```ts + import type { AddPluginConfig } from '@graphql-codegen/add'; + ``` + ## 5.0.2 ### Patch Changes diff --git a/packages/plugins/other/add/package.json b/packages/plugins/other/add/package.json index d0808aa6363..c5c46c2fcd8 100644 --- a/packages/plugins/other/add/package.json +++ b/packages/plugins/other/add/package.json @@ -1,6 +1,6 @@ { "name": "@graphql-codegen/add", - "version": "5.0.2", + "version": "5.0.3", "description": "GraphQL Code Generator plugin for adding custom content to your output file", "repository": { "type": "git", diff --git a/packages/presets/client/CHANGELOG.md b/packages/presets/client/CHANGELOG.md index 2b9b76c0b1e..3af9e18741a 100644 --- a/packages/presets/client/CHANGELOG.md +++ b/packages/presets/client/CHANGELOG.md @@ -1,5 +1,59 @@ # @graphql-codegen/client-preset +## 4.3.0 + +### Minor Changes + +- [#10001](https://github.com/dotansimha/graphql-code-generator/pull/10001) [`1be6e65`](https://github.com/dotansimha/graphql-code-generator/commit/1be6e65943b85162f3d465189d0a6df4b962df5d) Thanks [@n1ru4l](https://github.com/n1ru4l)! - Support discriminating `null` and `undefined` within the `useFragment` function. + + ```ts + function MyComponent(props: FragmentType | null) { + const data = useFragment(MyFragment, props); + // data is `MyFragment | null` + } + + function MyComponent(props: FragmentType | undefined) { + const data = useFragment(MyFragment, props); + // data is `MyFragment | undefined` + } + ``` + + Before, the returned type from `useFragment` was always `TType | null | undefined`. + +- [#9804](https://github.com/dotansimha/graphql-code-generator/pull/9804) [`5e594ef`](https://github.com/dotansimha/graphql-code-generator/commit/5e594ef8f39b9e1036b6bcaa977f914a66fec03e) Thanks [@rachel-church](https://github.com/rachel-church)! - Preserving `Array` or `ReadonlyArray` in `useFragment()` return type. + +### Patch Changes + +- [#9996](https://github.com/dotansimha/graphql-code-generator/pull/9996) [`99f449c`](https://github.com/dotansimha/graphql-code-generator/commit/99f449c8dcd645d49eda26e4ddfcb8ad7056ecbf) Thanks [@nahn20](https://github.com/nahn20)! - Added configuration to allow for custom hash functions for persisted documents in the client preset + + ### Example + + ```ts filename="codegen.ts" {10-12} + import { type CodegenConfig } from '@graphql-codegen/cli'; + + const config: CodegenConfig = { + schema: 'schema.graphql', + documents: ['src/**/*.tsx'], + generates: { + './src/gql/': { + preset: 'client', + presetConfig: { + persistedDocuments: { + hashAlgorithm: operation => { + const shasum = crypto.createHash('sha512'); + shasum.update(operation); + return shasum.digest('hex'); + }, + }, + }, + }, + }, + }; + ``` + +- Updated dependencies [[`5501c62`](https://github.com/dotansimha/graphql-code-generator/commit/5501c621f19eb5ef8e703a21f7367e07e41f199c)]: + - @graphql-codegen/add@5.0.3 + ## 4.2.6 ### Patch Changes diff --git a/packages/presets/client/package.json b/packages/presets/client/package.json index 8bb3a312b5c..3373db9d829 100644 --- a/packages/presets/client/package.json +++ b/packages/presets/client/package.json @@ -1,6 +1,6 @@ { "name": "@graphql-codegen/client-preset", - "version": "4.2.6", + "version": "4.3.0", "description": "GraphQL Code Generator preset for client.", "repository": { "type": "git", @@ -19,7 +19,7 @@ "dependencies": { "@babel/helper-plugin-utils": "^7.20.2", "@babel/template": "^7.20.7", - "@graphql-codegen/add": "^5.0.2", + "@graphql-codegen/add": "^5.0.3", "@graphql-codegen/typed-document-node": "^5.0.7", "@graphql-codegen/typescript": "^4.0.7", "@graphql-codegen/typescript-operations": "^4.2.1", diff --git a/website/package.json b/website/package.json index 012523e3189..2ee9213f28a 100644 --- a/website/package.json +++ b/website/package.json @@ -20,11 +20,11 @@ "prettier-plugin-tailwindcss": "0.2.8" }, "dependencies": { - "@graphql-codegen/add": "5.0.2", + "@graphql-codegen/add": "5.0.3", "@graphql-codegen/c-sharp": "4.3.1", "@graphql-codegen/c-sharp-operations": "2.3.1", "@graphql-codegen/cli": "5.0.2", - "@graphql-codegen/client-preset": "4.2.6", + "@graphql-codegen/client-preset": "4.3.0", "@graphql-codegen/core": "4.0.2", "@graphql-codegen/flow": "2.3.6", "@graphql-codegen/flow-operations": "2.3.6",