Multiple providers?February 6, 2019 at 2:55pm
Bit out of scope perhaps, but just asking for your $0.02.
I'm planning a site which will be approximately:
So, Next.js front end, pulling WP stuff via WPGraphQL and pulling Shopify stuff via either their Storefront API or the JS Buy SDK.
Assuming I can end up using the Shopify Storefront (GraphQL) API, would you say that the approach mentioned here (Gateway API: https://medium.com/open-graphql/apollo-multiple-clients-with-react-b34b571210a5) is the best way to structure things to let Apollo pull data from multiple providers?
February 6, 2019 at 9:38pm
February 7, 2019 at 10:56am
I found someone else that just wraps another ApolloProvider around the first one: https://spectrum.chat/?t=4c8e2898-86b0-4706-9771-7940523634f0 and uses an
as prop I can't find much about.
And then there's also react-apollo-multiple-clients: (https://github.com/titel-media/react-apollo-multiple-clients) which was made as a followup of that original Medium post.
Just to clarify: I don't know what the best way is, just sharing my findings.
@rafaelderolez that was my first thought, and it looks like the multiple client approach they've taken will indeed allow you to direct the right query to the right client. Thanks for sharing
Will give both of these a shot
@paulisloud If you get the first one to work, let me know! I didn't get far with the
I'm also wondering how this ties in with the Next.js's with-apollo example I'm using. It seems to extract the cache when using
April 23, 2019 at 8:30am