github dotansimha/graphql-code-generator @graphql-codegen/typescript-react-apollo@2.0.0

latest releases: release-1711538187754, @graphql-codegen/time@5.0.1, @graphql-codegen/client-preset@4.2.5...
3 years ago

Major Changes

  • 091dfea: Support Apollo-Client v3 by default (instead of v2), and generate React Hooks be default. HOC and Components are now disabled by default.

    Apollo Client v3 has React support integrated as part of the core package now, so that means that some imports, identifiers and usage should be updated. You can read more about migrating to Apollo-Client v3 here

    That means that imports are now generated from @apollo/client package, including gql tag. React Hooks are generated by default, and HOC and Components are not generated.

    Migration Notes

    If you are still using the deprecated react-apollo package, please set this configuration:

    config:
      reactApolloVersion: 2

    If you are still using the generated React HOC, please set this additional configuration:

    config:
      reactApolloVersion: 2
      withHOC: true

    If you are still using the generated React Components, please set this additional configuration:

    config:
      reactApolloVersion: 2
      withComponent: true

    If you don't need the generated React Hooks (turned on by default now), please also set:

    config:
      withHooks: false

Don't miss a new graphql-code-generator release

NewReleases is sending notifications on new releases.