Skip to content

Commit 1c70daf

Browse files
authored
Merge branch 'master' into add-gqlsp
2 parents 7036e00 + 71c92d5 commit 1c70daf

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

website/src/pages/plugins/presets/preset-client.mdx

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -491,6 +491,29 @@ console.log(response.status)
491491
console.log(await response.json())
492492
```
493493

494+
### Hashing algorithm
495+
496+
To override the default hash algorithm of sha1 set `persistedDocuments.hashAlgorithm`
497+
498+
```ts filename="codegen.ts" {10-12}
499+
import { type CodegenConfig } from '@graphql-codegen/cli'
500+
501+
const config: CodegenConfig = {
502+
schema: 'schema.graphql',
503+
documents: ['src/**/*.tsx'],
504+
generates: {
505+
'./src/gql/': {
506+
preset: 'client',
507+
presetConfig: {
508+
persistedDocuments: {
509+
hashAlgorithm: 'sha256'
510+
}
511+
}
512+
}
513+
}
514+
}
515+
```
516+
494517
### Normalized Caches (urql and Apollo Client)
495518

496519
Urql is a popular GraphQL client that utilizes a normalized cache.

0 commit comments

Comments
 (0)