React-apollo 2.5.5 doesn't add client to context
See original GitHub issueUsing offix 0.5.0. This is a basic react-native expo project as discussed in #23. With react-apollo 2.5.5 <ApolloConsumer> fails to find the client on the context. Pinning react-apollo to 2.5.2 works. I’m not sure if this is caused by a react-apollo bug or by offix. https://github.com/apollographql/react-apollo/issues/2900 discusses the issue but only when using MockedProvider and it appears a fix was put in for that.
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
Could not find "client" in the context of ApolloConsumer when ...
I have a React component that makes use of <ApolloConsumer> in order to access its client render prop and explicitly call client.query when...
Read more >React Apollo Error: Invariant Violation: Could not find "client ...
Invariant Violation: Could not find "client" in the context or passed in as an option. Wrap the root component in an , or...
Read more >Context Link - Apollo GraphQL Docs
The setContext function accepts a function that returns either an object or a promise, which then returns an object to set the new...
Read more >open-source-community/apollographql-react-apollo
Easy to use, human readable and machine processable release notes for everyone.
Read more >An Intro To Apollo GraphQL With React Hooks And Context API
Before creating the container components, let's write our first Apollo Client hook. Create usePetsHooks.js in hooks folder with the following code. import { ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top 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

Sorry I didn’t provide a snippet, I am providing the client to <ApolloProvider/> as you illustrated. That fails on react-apollo 2.5.5 but works on 2.5.2. I haven’t had the opportunity to dig further into the issue yet but I’ll update here if I find up with something. I’m more focused on getting a complete working example set up before investigating this since it has an easy workaround for now.
Tried that now with Apollo 2.6 and it felt that this was bug on their side.