diff --git a/website/src/pages/plugins/presets/preset-client.mdx b/website/src/pages/plugins/presets/preset-client.mdx index 3bd98db7a11..18417bf4a7d 100644 --- a/website/src/pages/plugins/presets/preset-client.mdx +++ b/website/src/pages/plugins/presets/preset-client.mdx @@ -491,6 +491,29 @@ console.log(response.status) console.log(await response.json()) ``` +### Hashing algorithm + +To override the default hash algorithm of sha1 set `persistedDocuments.hashAlgorithm` + +```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: 'sha256' + } + } + } + } +} +``` + ### Normalized Caches (urql and Apollo Client) Urql is a popular GraphQL client that utilizes a normalized cache.