Skip to content

What's the difference between PerQueryBatchedInvocationInput and PerRequestBatchedInvocationInput? #211

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

Closed
mxmlnglt opened this issue Oct 2, 2019 · 2 comments
Labels

Comments

@mxmlnglt
Copy link

mxmlnglt commented Oct 2, 2019

Hello,

I don't see the point of having these 2 classes, because they basically do the same thing:

@jmccaull
Copy link
Contributor

jmccaull commented Nov 5, 2019

There are subtle differences in how the context is supplied to each one. Depending on which context you select, the per query input will call the supplier for each input, where as the per request will call it once and provide the same context to each input.
The changes were made to align with Apollo's link module, https://www.apollographql.com/docs/link/links/batch-http/ see the section on context. I agree that having two different uses of the same supplier probably isn't optimal because it requires implementations to possibly anticipate which way they will be used. This logic specifically was broken out into an abstraction because otherwise it would require the enum to be passed around and lead to higher potential for inconsistency. There is potential for improvement/refactor here but it would touch a lot of the code base I think.

@oliemansm
Copy link
Member

@jmccaull Does the refactor in #217 open up possibilities to improve/refactor this part too?

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

No branches or pull requests

3 participants