@graphql-codegen/cli@5.0.0
Major Changes
Patch Changes
-
#9513
fdd19d24d
Thanks @cichelero! - Update yaml dependency to 2.3.1 -
Updated dependencies [
bb1e0e96e
]:- @graphql-codegen/plugin-helpers@5.0.1
@graphql-codegen/client-preset@4.1.0
Minor Changes
-
#9562
5beee9794
Thanks @n1ru4l! - Add theaddTypenameSelectionDocumentTransform
for automatically adding__typename
selections to all objct type selection sets.This is useful for GraphQL Clients such as Apollo Client or urql that need typename information for their cache to function.
Example Usage
import { addTypenameSelectionDocumentTransform } from '@graphql-codegen/client-preset'; import { CodegenConfig } from "@graphql-codegen/cli"; const config: CodegenConfig = { schema: "YOUR_GRAPHQL_ENDPOINT", documents: ["./**/*.{ts,tsx}"], ignoreNoDocuments: true, generates: { "./gql/": { preset: "client", plugins: [], presetConfig: { persistedDocuments: true, }, documentTransforms: [addTypenameSelectionDocumentTransform], }, }, }; export default config;
Patch Changes
- Updated dependencies [
bb1e0e96e
]:- @graphql-codegen/plugin-helpers@5.0.1