We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d48282a commit d4f4468Copy full SHA for d4f4468
.changeset/spicy-starfishes-press.md
@@ -4,3 +4,27 @@
4
---
5
6
Added configuration to allow for custom hash functions for persisted documents in the client preset
7
+
8
+### Example
9
+```ts filename="codegen.ts" {10-12}
10
+import { type CodegenConfig } from '@graphql-codegen/cli'
11
12
+const config: CodegenConfig = {
13
+ schema: 'schema.graphql',
14
+ documents: ['src/**/*.tsx'],
15
+ generates: {
16
+ './src/gql/': {
17
+ preset: 'client',
18
+ presetConfig: {
19
+ persistedDocuments: {
20
+ hashAlgorithm: operation => {
21
+ const shasum = crypto.createHash('sha512')
22
+ shasum.update(operation)
23
+ return shasum.digest('hex')
24
+ }
25
26
27
28
29
+}
30
+```
0 commit comments