Skip to content

@graphql-codegen/typescript-react-apollo@2.0.0

Compare
Choose a tag to compare
@dotansimha dotansimha released this 03 Aug 17:08
· 3272 commits to master since this release

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