Closed henrikx closed 1 year ago
I do not think that there is a bug but its due to how its used in your code. Its difficult to tell. If you think there is an issue create a very small repro that shows your issue in a simple an understandable way and we will have a look at it.
Closing this issue for now.
@michaelstaib Just wanted to bring you an update to tell you that you were absolutely right and that there was no bug. Turns out I had forgotten to run HttpResponseMessage.EnsureSuccessStatusCode
in my DataLoader and I was being rate-limited by the API when running asynchronously. Probably as requests were being sent almost at the same time. Can't believe I missed something so obvious. Anyways, thanks for pointing me in the right direction :)
Is there an existing issue for this?
Product
Green Donut
Describe the bug
I am not sure if it is an issue with my implementation or whether there is a bug.
Given the following query:
In the Query-class I have the following resolver to get the rooms:
This is the Room-class with the
Bookings
-resolver to fetch the bookings:All the dataloaders in
Bookings
are CacheDataLoaders except forbookingsystemObjectByIdsDataLoader
which is a BatchDataLoader. This is where the error occurs; When HotChocolate executes theBookings
-resolver in parallel for each node inrooms
, thebookingsystemObjectByIdsDataLoader
-dataloader only returns the response for some of the nodes and it seems completely random which nodes get results from the DataLoader. Additionally, batching does not work andLoadBatchAsync
gets called for every node. Isn't it meant to wait until all the nodes have made their requests and then runLoadBatchAsync
once for the whole query, or have i misunderstood something?I was able to workaround this issue by making the
Bookings
-method synchronus, but this is not an acceptable solution because it makes batching impossible and thus the query becomes slow.Steps to reproduce
Relevant log output
No response
Additional Context?
No response
Version
13.3.0 (however this also happened in 12.16)