-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Add apolloBatchIndex
and apolloBatchSize
fields on the context
object
#177
Conversation
This lets users detect whether or not their query is running in a batch, which is useful for performance debugging.
Do we want to include this even when there's no batching? ie, is there any point to distinguishing between "sent a single query" and "sent a size-1 batch"? (I don't know the answer, just though it was worth asking.) |
Oh, right, I suggested that to @helfer in person and he agreed it was a good idea, then I forgot to implement it. Will add unless someone suggests a reason why it would be bad to distinguish. |
Few comments i want to raise:
would like to hear more thoughts :) |
I'm not sure I follow exactly what you're suggesting, but it makes me think
that we should just add a single apollo or apolloContext field to the
context and hang things like these numbers off of it.
|
The current PR has both @DxCx The situation is I'm trying to find a way to distinguish which query a resolver is running in the context of, for https://github.com/apollostack/optics-agent-js. |
@n1mmy okay, then let's create an In the medium to long term I think we should move batching into the core, which will also simplify the integrations. |
Closing in favor of #182 |
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
This is so that users can detect when clients have requested batching. This will be useful for performance monitoring (see https://github.com/apollostack/optics-agent-js/issues/47)