Skip to content

Commit 5aa8a17

Browse files
committed
Add breaking changes for persisted doc hash algorithm and ESM deps inclusino
1 parent dee7391 commit 5aa8a17

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

website/src/pages/docs/migration/operations-and-client-preset-from-5-0.mdx

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -397,3 +397,21 @@ Now, the default type is `unknown` to ensure data is handled carefully by users.
397397
Previously, one set of default Scalar types was shared between client and server plugins via the `typescript` plugin dependency. This meant it was not possible to set the default for client, as it would complicate the server config, and vice versa. See this [PR for more details](https://github.com/dotansimha/graphql-code-generator/pull/9497).
398398
399399
Now, the `typescript` plugin is no longer a dependency. So, we can set the default type as `string | number`, which is the correct type for client use cases. For more details on how Scalar coercion works here, please read [The Complete GraphQL Scalar Guide](https://the-guild.dev/graphql/hive/blog/the-complete-graphql-scalar-guide#scalar-value-coercion).
400+
401+
### 13. client-preset persisted document default hash algorithm is SHA256
402+
403+
Previously, the default hash algorithm for persisted documents was `sha1`.
404+
405+
Now, the default is `sha256`. When using `sha256`, the generated hash conforms to the format defined in the [GraphQL over HTTP spec for persisted document identifiers](https://github.com/graphql/graphql-over-http/blob/52d56fb36d51c17e08a920510a23bdc2f6a720be/spec/Appendix%20A%20--%20Persisted%20Documents.md#sha256-hex-document-identifier).
406+
407+
### 14. Core plugins have ESM dependencies
408+
409+
<Callout>
410+
This change mainly impacts plugin maintainers.
411+
</Callout>
412+
413+
Previously, core plugins were stuck on older dependency versions because ESM-only packages made integration and testing harder for maintainers.
414+
415+
Now, Node.js 20 support has been dropped, Node.js 22 can load ESM seamlessly at runtime, with no extra configuration. This allows core plugins to adopt dependencies that are ESM-only.
416+
417+
Plugin maintainers using [Jest](https://jestjs.io/) may still encounter issues. We recommend switching to [Vitest](https://vitest.dev/), which has native ESM support.

0 commit comments

Comments
 (0)