Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple Apollo instances implementation #121

Closed
coferrari opened this issue Nov 1, 2023 · 2 comments
Closed

Multiple Apollo instances implementation #121

coferrari opened this issue Nov 1, 2023 · 2 comments

Comments

@coferrari
Copy link

Hi, can multiple Apollo instances be created to connect them to different APIs? If so, can you please provide an example of the implementation? Thanks in advance

@phryneas
Copy link
Member

phryneas commented Nov 2, 2023

For RSC, you could call registerApolloClient multiple times.

In Client Components, this is currently not possible.
Generally, in most cases where you have to access multiple APIs, you would use the same Apollo Client instance and decide in the link chain, which API should be queried for it - assuming both APIs do not have overlap in types.

@coferrari
Copy link
Author

Perfect @phryneas thanks for your fast response! I did it following Directional composition

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants