Prevent Dataloader from loading association that is already in memory after graphql mutation

@axelson, thanks for response.

It seems strange to me that even in this simple example Dataloader doesn’t provide something out of the box. All it have to do is check where relation (that should be rendered in mutation response) is loaded or not.

In my opinion practicing approach I provided above would lead you to mess - you would need to have these helpers for all of your relations.

I’m pretty new to GraphQL, but for now it seems that there are a lot of problems with control over DB logic.
In REST you control pretty everyting (in terms of DB queries and their number).
Here, in GraphQL, you control much less.
Even my simple example shows that default logic would perform unnecessary DB roundtrips.

Aren’t there any other solutions to this problem?