-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support apollo-client v3 and it's hooks by default, deprecate hoc and…
… components. Updated all imports to latest (#4487) * support apollo-client v3 andi t's hooks by default, deprecate hoc and components. Updated all imports to latest * added changeset with migration notes * fixed for grouping all apollo related imports under the same namespace
- Loading branch information
1 parent
74b5106
commit 091dfea
Showing
32 changed files
with
3,074 additions
and
2,843 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
--- | ||
'@graphql-codegen/typescript-react-apollo': major | ||
--- | ||
|
||
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](https://www.apollographql.com/docs/react/migrating/apollo-client-3-migration/) | ||
|
||
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](https://github.com/apollographql/react-apollo) `react-apollo` package, please set this configuration: | ||
|
||
```yaml | ||
config: | ||
reactApolloVersion: 2 | ||
``` | ||
|
||
If you are still using the generated React HOC, please set this additional configuration: | ||
|
||
```yaml | ||
config: | ||
reactApolloVersion: 2 | ||
withHOC: true | ||
``` | ||
|
||
If you are still using the generated React Components, please set this additional configuration: | ||
|
||
```yaml | ||
config: | ||
reactApolloVersion: 2 | ||
withComponent: true | ||
``` | ||
|
||
If you don't need the generated React Hooks (turned on by default now), please also set: | ||
|
||
```yaml | ||
config: | ||
withHooks: false | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.