-
Notifications
You must be signed in to change notification settings - Fork 1.2k
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
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
Support for apollo batching #433
Comments
This is a really really ugly proof of concept, but it actually works. Things one probably wants to take into account is the number of concurrent operations running. Secondly, I have no idea how the tracing gets affected by this code. Thirdly, No mutexes around the responses slice, https://stackoverflow.com/questions/49879322/can-i-concurrently-write-different-slice-elements not sure if it's a good idea but too lazy to abstract away the boilerplate |
Thanks @macnibblet — this is a great reference for anyone that is interested in implementing this now. It does highlight that |
@mathewbyrne If someone can confirm the tracing works with the way I have implemented it now I have no problem turning it from a proof of concept to production worthy code. I could use this in production for a few applications we are running with this awesome library. |
@vektah Do you have any comments on how the tracing should work when batching? Else ill update my POC and create a merge request. |
I don't think batching can happen concurrently without a bit more work to establish sync boundaries. Consider a batch that looks like this:
I would expect to get back
The suggested implementation would likely do something very different. I'm not sure how apollo tracing + batching should work, someone would need to fire up a server and have a look at whats in the extensions. It probably keeps each req/resp separate. Also make sure you base any work on the |
@vektah AFAIK you are not allowed to mix queries and mutations? Regards to the tracing, do we want to split each operation into a single request or have them under the same request? |
Ahh right, lets make sure we have some validation covering that.
I think that makes sense, still worth having a look at what apollo server does with tracing turned on. apollo tracing is returned in the extensions key of the response, so I imagine its per query/mutation. |
We're interested in this feature too. Happy to collaborate on an implementation. |
Hi everyone, I'm also interested in this feature 😀 Any news on the advancement? Thank you, |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
No stale. |
Interested in this as well |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Nope, stale. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Still interested 😉 |
Can we disable stale for some issues? |
Would this be easier given the recent handler refactor? |
yeah would love to see this as well! |
I'm interested in funding/sponsoring this enhancement. I'm not sure how it would work through the 99designs organization but happy to work with individuals directly. If anyone else is interested in pitching in, add an 👀 reaction! |
I would like this feature as well. To work better with the nautilus gateway batching https://gateway.nautilus.dev/advanced/batching |
Digging around the apollo-server implementation this limitation does not appear to be codified. From looking through some issues it appears this behaviour is intentional
Essentially it's the client responsibility to not create batched requests that would result in undesirable race conditions. More context |
Any plans to implement that? |
Hi @lwc , it seems you are the latest 99designs team member who contributed over the last months to this project. Do you know if there is any interest from your team for this batching feature? Thank you, |
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
It would be awesome if we could detect batch operations based on a header and then parse the incoming request as an array of operations or a single operation.
The text was updated successfully, but these errors were encountered: