You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 13, 2023. It is now read-only.
The original author of the client option PR was silent for 6 months, then posted this, indicating that he's no longer interested in working on it.
If the client option is deprecated, it would probably be good to post something, including a comment on the PR above so that subscribers see it, and a recommended approach to addressing a requirement for multiple clients.
The best way forward may be influenced by the functionality provided by the QueryRecyclerProvider in <ApolloProvider>; I'm afraid I don't understand what it does.
The following code line from current version (2.1.9) and both Query and Mutation gives precedence to props client. So we can indeed override the default client via props.
The feature is not documented though.
In addition to that the most common approach would be having a Gateway API running GraphQL and managing queries to different targets APIs. I wrote this article discussing some approaches if you really want to do that and pointing out some pros and cons.
Activity
astorije commentedon Apr 10, 2018
That would be great! We currently have a use case where we need to talk to more than one client, so that would make things cleaner.
peaonunes commentedon Aug 14, 2018
The following code line from current version (2.1.9) and both
Query
andMutation
gives precedence to propsclient
. So we can indeed override thedefault client
viaprops
.You would use like:
The feature is not documented though.
In addition to that the most common approach would be having a Gateway API running GraphQL and managing queries to different targets APIs. I wrote this article discussing some approaches if you really want to do that and pointing out some pros and cons.
[-][enhancement 2.1] Add client option to new <Query>[/-][+]Document client prop[/+]rosskevin commentedon Dec 27, 2018
Please PR any docs you would like to see. Client prop is definitely not going away.
danilobuerger commentedon Jan 29, 2019
Documented here: https://www.apollographql.com/docs/react/api/react-apollo.html#query-render-prop