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

Implement Apollo Link #3452

Closed
wow-such-amazing opened this issue Oct 1, 2024 · 2 comments
Closed

Implement Apollo Link #3452

wow-such-amazing opened this issue Oct 1, 2024 · 2 comments
Labels
feature New addition or enhancement to existing solutions

Comments

@wow-such-amazing
Copy link
Contributor

wow-such-amazing commented Oct 1, 2024

Use case

There are cases when you need to run Query A in order to have information to run Query B. Of course there are ways to solve this issue on the schema level, but it's not always possible.

Describe the solution you'd like

I've found this solution on the react framework which seems to be solving this exact issue. And I think it will be interesting to have it in the ios framework as well 👀

Though it's not an urgent one of course and in the meantime we can combine requests on our own in the code.

https://www.apollographql.com/docs/react/api/link/introduction

@wow-such-amazing wow-such-amazing added the feature New addition or enhancement to existing solutions label Oct 1, 2024
@BobaFetters
Copy link
Member

@wow-such-amazing ApolloLink functions as a middleware in the networking layer to handle the steps of executing a single query. This wouldn’t inherently solve the problem of needing data from Query A to pass to Query B unless you are adding a link to your chain to do so, which is probably a bad design choice, since the chain is run on every query, not just Query A. This functions similarly to the existing interceptor chain setup in Apollo iOS which also acts as a middleware to handle steps of a single operation. Theoretically you could have an interceptor to handle what you are asking, but the right way to handle this would be to run Query A in your code and then take the result and run Query B.

We are currently working on a 2.0 version which will rework the networking layer of Apollo iOS, here is the RFC for that, however this also won’t solve the issue described.

Copy link
Contributor

github-actions bot commented Oct 1, 2024

Do you have any feedback for the maintainers? Please tell us by taking a one-minute survey. Your responses will help us understand Apollo iOS usage and allow us to serve you better.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New addition or enhancement to existing solutions
Projects
None yet
Development

No branches or pull requests

2 participants