apollo-client dependency is outdated; causes TypeScript errors
See original GitHub issueI’m getting the following TS error:
ERROR in /Volumes/SuperData/Sites/reelcrafter/reelcrafter-ui/src/bootstrap/apollo.ts
20:3 Type 'AWSAppSyncClient<NormalizedCacheObject>' is missing the following properties from type 'ApolloClient<any>': clearStoreCallbacks, clientAwareness, stop, onClearStore
18 |
19 | export const apolloProvider = new VueApollo({
> 20 | defaultClient: client,
| ^
21 | });
22 |
AppSync works fine when it uses its own version of apollo-client that it depends on. But vue-apollo requires us to run yarn add apollo-client
which installs a newer version that causes AppSync’s types to break.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:4
- Comments:7 (5 by maintainers)
Top Results From Across the Web
Hooks - Apollo GraphQL Docs
Deprecated. If true , causes a query refetch if the query result is detected as partial. Setting this option is unnecessary in Apollo...
Read more >Apollo Client Error: Could not find "client" in the context or ...
I had luck with downgrading @apollo/client from v3.5.x to v3.4.17 , and my tests (which is where I got this error) started passing...
Read more >Angular & Apollo Client: Getting Started with GraphQL in ...
Writing queries & mutations using the Apollo client library; Generating TypeScript types from the server-side schema by graphql-code-generator ...
Read more >Integrate TypeScript with GraphQL using TypeGraphQL
Bootstrapping our TypeScript GraphQL application; Installing dependencies; Setting up our Apollo server; TypeGraphQL database schema fields ...
Read more >The React + Apollo Tutorial for 2020 (Real-World Examples)
Plus it makes working with React and GraphQL a lot easier by giving us a lot ... with npm: npm i @apollo/react-hooks apollo-client...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Also had this problem. We resolved it by doing this. Yes it’s a hack, but at least you can get by until the issue is resolved. 😄
Given this appsync config:
And then doing:
Hello everyone - I want to reply and assure you that we have not abandoned support of this project. Per my earlier comment, this is a complex process and to be completely transparent there are things in the Apollo library that are out of our control and there have also been breaking changes in Apollo versions which we’re trying to account for, which is also why we pinned the version. We’ve been spending many hours trying to account for this but it’s not simple to solve. After putting more thought into this we’ve got some initial solutions that I hope will unblock many of you. What we’ve done is packaged two of the “Links” which are part of the SDK - the Auth and Subscription Links - and published them to NPM. This will allow you to include them in the newer Apollo versions if you wish to use the newer features. This does not include the “Offline Link” for offline support which is more complex to solve and we’re looking into for the future.
Installation of the links:
Usage: https://github.com/awslabs/aws-mobile-appsync-sdk-js#using-authorization-and-subscription-links-with-apollo-client-no-offline-support
With is I would then give the following recommendations for choosing your client strategy:
Please let us know if you have any trouble using these links or if there is a scenario which we haven’t accounted for here.