Replies: 2 comments 1 reply
-
|
So let's say you load book 1 and book 2. You're seeing |
Beta Was this translation helpful? Give feedback.
-
|
I have found the same problem but with a tiny different approach. In my case, I have an object with two attributes, both of them containing a new object that must be treated by the dataloader. I will present a context similar to the discussion created. Imagine that you have a shareBook mutation where you indicate a book to give and a book to receive. It could have more fields but I will simplify it. In this case, when we use a BookDataLoader, it will be called twice if it is a mutation (e.g. create a shareBook registry), but it will be called once if it is a query (e.g. find a shareBook object by ID). I think it's a library error, but it would be great if someone can propose a solution or at least an explanation about why mutation is being processed differently. Thanks. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I'll omit unimportant parts for simplicity but I throw the following request to create multiple books.
Then the following code runs and
AuthorsLoader#loadis called multiple times.As a result I have the N + 1 problem.
As you know, this problem doesn't occurred on query requests.
How do I resolve?
Would be great if someone can help.
Thanks
Beta Was this translation helpful? Give feedback.
All reactions