Skip to content

Commit cac19e5

Browse files
Upcoming Release Changes (#10000)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent 5501c62 commit cac19e5

File tree

9 files changed

+69
-67
lines changed

9 files changed

+69
-67
lines changed

.changeset/fresh-files-push.md

Lines changed: 0 additions & 19 deletions
This file was deleted.

.changeset/polite-dancers-warn.md

Lines changed: 0 additions & 9 deletions
This file was deleted.

.changeset/proud-cycles-design.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

.changeset/spicy-starfishes-press.md

Lines changed: 0 additions & 29 deletions
This file was deleted.

packages/plugins/other/add/CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
# @graphql-codegen/add
22

3+
## 5.0.3
4+
5+
### Patch Changes
6+
7+
- [#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.
8+
9+
```ts
10+
import type { AddPluginConfig } from '@graphql-codegen/add';
11+
```
12+
313
## 5.0.2
414

515
### Patch Changes

packages/plugins/other/add/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@graphql-codegen/add",
3-
"version": "5.0.2",
3+
"version": "5.0.3",
44
"description": "GraphQL Code Generator plugin for adding custom content to your output file",
55
"repository": {
66
"type": "git",

packages/presets/client/CHANGELOG.md

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,59 @@
11
# @graphql-codegen/client-preset
22

3+
## 4.3.0
4+
5+
### Minor Changes
6+
7+
- [#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.
8+
9+
```ts
10+
function MyComponent(props: FragmentType<typeof MyFragment> | null) {
11+
const data = useFragment(MyFragment, props);
12+
// data is `MyFragment | null`
13+
}
14+
15+
function MyComponent(props: FragmentType<typeof MyFragment> | undefined) {
16+
const data = useFragment(MyFragment, props);
17+
// data is `MyFragment | undefined`
18+
}
19+
```
20+
21+
Before, the returned type from `useFragment` was always `TType | null | undefined`.
22+
23+
- [#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<T>` or `ReadonlyArray<T>` in `useFragment()` return type.
24+
25+
### Patch Changes
26+
27+
- [#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
28+
29+
### Example
30+
31+
```ts filename="codegen.ts" {10-12}
32+
import { type CodegenConfig } from '@graphql-codegen/cli';
33+
34+
const config: CodegenConfig = {
35+
schema: 'schema.graphql',
36+
documents: ['src/**/*.tsx'],
37+
generates: {
38+
'./src/gql/': {
39+
preset: 'client',
40+
presetConfig: {
41+
persistedDocuments: {
42+
hashAlgorithm: operation => {
43+
const shasum = crypto.createHash('sha512');
44+
shasum.update(operation);
45+
return shasum.digest('hex');
46+
},
47+
},
48+
},
49+
},
50+
},
51+
};
52+
```
53+
54+
- Updated dependencies [[`5501c62`](https://github.com/dotansimha/graphql-code-generator/commit/5501c621f19eb5ef8e703a21f7367e07e41f199c)]:
55+
- @graphql-codegen/add@5.0.3
56+
357
## 4.2.6
458

559
### Patch Changes

packages/presets/client/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@graphql-codegen/client-preset",
3-
"version": "4.2.6",
3+
"version": "4.3.0",
44
"description": "GraphQL Code Generator preset for client.",
55
"repository": {
66
"type": "git",
@@ -19,7 +19,7 @@
1919
"dependencies": {
2020
"@babel/helper-plugin-utils": "^7.20.2",
2121
"@babel/template": "^7.20.7",
22-
"@graphql-codegen/add": "^5.0.2",
22+
"@graphql-codegen/add": "^5.0.3",
2323
"@graphql-codegen/typed-document-node": "^5.0.7",
2424
"@graphql-codegen/typescript": "^4.0.7",
2525
"@graphql-codegen/typescript-operations": "^4.2.1",

website/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@
2020
"prettier-plugin-tailwindcss": "0.2.8"
2121
},
2222
"dependencies": {
23-
"@graphql-codegen/add": "5.0.2",
23+
"@graphql-codegen/add": "5.0.3",
2424
"@graphql-codegen/c-sharp": "4.3.1",
2525
"@graphql-codegen/c-sharp-operations": "2.3.1",
2626
"@graphql-codegen/cli": "5.0.2",
27-
"@graphql-codegen/client-preset": "4.2.6",
27+
"@graphql-codegen/client-preset": "4.3.0",
2828
"@graphql-codegen/core": "4.0.2",
2929
"@graphql-codegen/flow": "2.3.6",
3030
"@graphql-codegen/flow-operations": "2.3.6",

0 commit comments

Comments
 (0)