Open JoePassanante opened 1 year ago
Hey @JoePassanante 👋
This is an interesting idea!
Would you be able to expand upon the use cases for this type of behavior? You mention the batch link as an example, but could you describe further what advantages a conditional batch link has over http link in the case of polling?
Are there other use cases you can think of where this behavior would be beneficial or otherwise impossible without this solution?
Proposal
The Apollo Link Operation should be passed additional context from internal decisions made when crafting that request.
For example, when queries are created from a poling interval being triggered a link should understand that this was the source. Allowing, the split link can decide if an operation came from polling it should be moved into a batch link or a normal HTTP link.
Interface
For example
I'm not sold on having an enum, but want the context to be strongly typed. Its coming from Apollos internal implementation, so it shouldn't be generic.