Skip to content
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

Missing part of the response when using batched queries #7739

Closed
alex123098 opened this issue Nov 19, 2024 · 4 comments · Fixed by #7832
Closed

Missing part of the response when using batched queries #7739

alex123098 opened this issue Nov 19, 2024 · 4 comments · Fixed by #7832
Assignees
Milestone

Comments

@alex123098
Copy link

Product

Hot Chocolate

Version

14.1.0

Link to minimal reproduction

https://github.com/alex123098/hc-race-condition

Steps to reproduce

  1. Make sure you have curl installed
  2. Clone the repository
  3. Run the project using dotnet run
  4. Run the repro.sh script, which sends two queries batched into a single HTTP request
  5. Observe the output of the script

What is expected?

I expect one of 2 valid outputs:

---
Content-Type: application/json; charset=utf-8

{"requestIndex":1,"data":{"author":{"name":"Jon Skeet"}}}
---
Content-Type: application/json; charset=utf-8

{"requestIndex":0,"data":{"book":{"title":"C# in depth."}}}
-----

or

---
Content-Type: application/json; charset=utf-8

{"requestIndex":0,"data":{"book":{"title":"C# in depth."}}}
---
Content-Type: application/json; charset=utf-8

{"requestIndex":1,"data":{"author":{"name":"Jon Skeet"}}}
-----

What is actually happening?

4 times out of 5 the server returns results of only one query from the batch

Relevant log output

Additional context

I get the expected behavior if I remove calls to Task.Delay from both resolvers.

@michaelstaib
Copy link
Member

This is the expected behavior... this is the new request batching protocol. Thats why it has a request index so that we can stream it down. This is part of the new composite schema specification effort we are doing together with Apollo, Netflix and The Guild.

@michaelstaib
Copy link
Member

Ah ... what you are saying is that one output is missing? I will have a look at it.

@michaelstaib
Copy link
Member

michaelstaib commented Nov 21, 2024

This is the expected behavior

was referring to the fact that it can be out of order.

@michaelstaib
Copy link
Member

@alex123098 check out the following release and reopen if its not fixed with it.
https://github.com/ChilliCream/graphql-platform/releases/tag/14.3.0-p.2

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

Successfully merging a pull request may close this issue.

2 participants