forked from dotansimha/graphql-code-generator-community
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(typescript-react-apollo): support useBackgroundQuery and useLoad…
…ableQuery Implement `useBackgroundQuery` and `useLoadableQuery` hooks for React Apollo. These APIs are added in 3.8.0 and 3.9.0 respectively. Suspense support in Apollo Client provides 5 new hooks as described in https://www.apollographql.com/docs/react/data/suspense/. `useSuspenseQuery` support was added in dotansimha#434. Among other 4 hooks, `useBackgroundQuery` and `useLoadableQuery` are the ones that take a GraphQL document as an argument like other existing hooks. The support for these hooks are added in this change. Other hooks, `useQueryRefHanders` and `useReadQuery` do not take a GraphQL document as an argument, so they do not need to be added as the generated code. Both take the return values of other hooks as an argument, and the types are inferred from it.
- Loading branch information
Showing
21 changed files
with
952 additions
and
79 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
Oops, something went wrong.