graphql-platform icon indicating copy to clipboard operation
graphql-platform copied to clipboard

HC12 Batching only executes first operation

Open MarcoCunha0 opened this issue 3 years ago • 8 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

Describe the bug

I noticed that in HC12, when i make a batch of requests i am only getting the result to the first operation. This issue was already reported in slack by Chris Harris.

According to Chris, this issue seems to be localized in the MultiPartResponseStreamSerializer and his proposal worked for me, which is using:

services.AddHttpResultSerializer(
   batchSerialization: HttpResultSerialization.JsonArray
);

Steps to reproduce

Make a request with a batch of operations:

[
	{
		"query": "query DummyQuery1 { buildVersion }",
		"operationName": "DummyQuery1"
	},
    {
		"query": "query DummyQuery2 { buildVersion }",
		"operationName": "DummyQuery2"
	}
]

Response:

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

{"data":{"buildVersion":"1.0.22011.112"}}
-----

Relevant log output

No response

Additional Context?

No response

Product

Hot Chocolate

Version

12.4.1

MarcoCunha0 avatar Jan 13 '22 15:01 MarcoCunha0

We have started work on batching.

michaelstaib avatar Jan 19 '22 10:01 michaelstaib

This bug is still present in 12.7.0. Im unsure how to give further detail of the bug. I created a fresh project following the getting started section of the docs and here the bug is present aswell.

Helsing112 avatar Mar 28 '22 07:03 Helsing112

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.

stale[bot] avatar May 27 '22 08:05 stale[bot]

@michaelstaib this issue is reproducible in v12.12.1, for now the workaround is to use HttpResultSerialization.JsonArray but by using it we lose the incremental delivery over HTTP. Any suggestions there?

katyalh avatar Aug 09 '22 15:08 katyalh

I think @michaelstaib fixed this in v13

nelsonprsousa avatar Aug 09 '22 15:08 nelsonprsousa

@nelsonprsousa @michaelstaib by any chance there will be a release including a fix for this issue against v12 or do we need to wait v13 release?

katyalh avatar Aug 09 '22 18:08 katyalh

I think @michaelstaib fixed this in v13

I have tried the same with v13.0.0-preview.28, this issue is reproducible there as well

katyalh avatar Aug 10 '22 11:08 katyalh

Not sure yet where we put this. We will fix it. But have no clue when yet. I will reevaluate this at the end of this month. At the moment everyone in the team busy on other topics.

michaelstaib avatar Aug 10 '22 16:08 michaelstaib

This is now fixed and will be integrated into 12.14.0-preview.1

michaelstaib avatar Sep 08 '22 21:09 michaelstaib