You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This looks to be the sort of solution we are looking for, but I'm struggling to think of how to make the resolver work while using a DB as the data source.
Your example walks the array 1 by 1 which would be like firing a query for each user which defeats the point of dataloader.
Best I can think is to chain UNION's together:
(SELECT * FROM child WHERE parent_id = 1 LIMIT 10) UNION ALL (SELECT * FROM child WHERE parent_id = 2 LIMIT 10)...
That's seems like minimal optimization (haven't tested so maybe even union'ing saving on multiple roundtrips is significant).
Any other approaches I'm missing? This feels like something you would commonly want to do -- limit child properties from returning infinite results, but I'm struggling to find a good implementation on it.
The text was updated successfully, but these errors were encountered:
This looks to be the sort of solution we are looking for, but I'm struggling to think of how to make the resolver work while using a DB as the data source.
Your example walks the array 1 by 1 which would be like firing a query for each user which defeats the point of dataloader.
Best I can think is to chain UNION's together:
(SELECT * FROM child WHERE parent_id = 1 LIMIT 10) UNION ALL (SELECT * FROM child WHERE parent_id = 2 LIMIT 10)...
That's seems like minimal optimization (haven't tested so maybe even union'ing saving on multiple roundtrips is significant).
Any other approaches I'm missing? This feels like something you would commonly want to do -- limit child properties from returning infinite results, but I'm struggling to find a good implementation on it.
The text was updated successfully, but these errors were encountered: