Apollo-Client Helpers
Generates helpers for improving the integration of TypeScript and Apollo-Client, based on your schema. This plugin generates fully-typed keyFields and Type-Policies for Apollo-Client.
- Version
- 4.0.1
- Weekly downloads
- 196k
- License
- MIT
- Updated
- Apr 19, 2026
Installation
npm i -D @graphql-codegen/typescript-apollo-client-helpers
yarn add -D @graphql-codegen/typescript-apollo-client-helpers
pnpm add -D @graphql-codegen/typescript-apollo-client-helpers
bun add -D @graphql-codegen/typescript-apollo-client-helpers
Config API Reference
useTypeImports
type: boolean
Will use import type {} rather than import {} when importing only types. This gives
compatibility with TypeScript’s “importsNotUsedAsValues”: “error” option
Default value: “false”
requireKeyFields
type: boolean
Remove optional sign from all keyFields fields.
Default value: “false”
requirePoliciesForAllTypes
type: boolean
Remove optional sign from all generated keys of the root TypePolicy. Default value: “false”
This plugin generates helpers for improving the integration of TypeScript and Apollo-Client, based on your schema.
This plugin generates fully-typed keyFields and Type-Policies for Apollo-Client.
How to use?
Start by adding this plugin to your configuration:
Then, use the generated TypeScript type as your signature for typePolicies: