Skip to content

Commit

Permalink
Updates Client Preset Persisted Documents documentation with hashAlgo…
Browse files Browse the repository at this point in the history
…rithm options (#9760)
  • Loading branch information
schweetheart authored Dec 1, 2023
1 parent f28ae31 commit 71c92d5
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions website/src/pages/plugins/presets/preset-client.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 71c92d5

Please sign in to comment.