Support for apollo batching #1932
Replies: 28 comments 1 reply
-
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 |
Beta Was this translation helpful? Give feedback.
-
Thanks @macnibblet — this is a great reference for anyone that is interested in implementing this now. It does highlight that |
Beta Was this translation helpful? Give feedback.
-
@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. |
Beta Was this translation helpful? Give feedback.
-
@vektah Do you have any comments on how the tracing should work when batching? Else ill update my POC and create a merge request. |
Beta Was this translation helpful? Give feedback.
-
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 |
Beta Was this translation helpful? Give feedback.
-
@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? |
Beta Was this translation helpful? Give feedback.
-
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. |
Beta Was this translation helpful? Give feedback.
-
We're interested in this feature too. Happy to collaborate on an implementation. |
Beta Was this translation helpful? Give feedback.
-
Hi everyone, I'm also interested in this feature 😀 Any news on the advancement? Thank you, |
Beta Was this translation helpful? Give feedback.
-
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. |
Beta Was this translation helpful? Give feedback.
-
No stale. |
Beta Was this translation helpful? Give feedback.
-
Interested in this as well |
Beta Was this translation helpful? Give feedback.
-
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. |
Beta Was this translation helpful? Give feedback.
-
Nope, stale. |
Beta Was this translation helpful? Give feedback.
-
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. |
Beta Was this translation helpful? Give feedback.
-
Still interested 😉 |
Beta Was this translation helpful? Give feedback.
-
Can we disable stale for some issues? |
Beta Was this translation helpful? Give feedback.
-
Would this be easier given the recent handler refactor? |
Beta Was this translation helpful? Give feedback.
-
yeah would love to see this as well! |
Beta Was this translation helpful? Give feedback.
-
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! |
Beta Was this translation helpful? Give feedback.
-
I would like this feature as well. To work better with the nautilus gateway batching https://gateway.nautilus.dev/advanced/batching |
Beta Was this translation helpful? Give feedback.
-
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 |
Beta Was this translation helpful? Give feedback.
-
Any plans to implement that? |
Beta Was this translation helpful? Give feedback.
-
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, |
Beta Was this translation helpful? Give feedback.
-
Happy to lead a meeting about implementing the feature, if there are people interested in contribution. |
Beta Was this translation helpful? Give feedback.
-
I'm seeing this has gone fairly quiet for the last year. Is this something you all are still considering supporting? I'd be happy to contribute. |
Beta Was this translation helpful? Give feedback.
-
Interested in the feature! 🚀 |
Beta Was this translation helpful? Give feedback.
-
looks like someone already made a decent extension .. im gonna test it and let you know :) |
Beta Was this translation helpful? Give feedback.
-
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.
Beta Was this translation helpful? Give feedback.
All reactions