Joe
04/17/2020, 10:59 PMallUsers()
query to the nested fields documentation page schema, and having a client request allUsers() {photos(1)}
to get the first photo for each user)? Exposing the nested children as a function is really cool from a simplicity of writing code perspective, but ends up executing one fetch per Parent (exposing it as a suspend function at least runs them concurrently). Is looking at the DataFetchingEnvironment
and then performing different fetch logic based on the selectionSet the best way to try to optimize the fetches? Or is there another/better way of thinking about this use case?Dariusz Kuc
04/17/2020, 11:05 PMDariusz Kuc
04/17/2020, 11:06 PMDariusz Kuc
04/17/2020, 11:07 PMJoe
04/17/2020, 11:09 PMallUsers() { leadPhoto }
case that I'm interested in populating via constant number of queries instead of O(n) queries.Dariusz Kuc
04/18/2020, 12:02 AMDariusz Kuc
04/18/2020, 12:02 AMDariusz Kuc
04/18/2020, 12:03 AMJoe
04/18/2020, 12:14 AMDariusz Kuc
04/18/2020, 12:55 AMDariusz Kuc
04/18/2020, 12:55 AMDariusz Kuc
04/18/2020, 12:55 AMJoe
06/11/2020, 11:27 PMdfe.getDataLoader().load()
from a function of the User
model object and returning that CompleteableFuture<Photo>
, which was not completely obvious from the examples / documentation, but also wasn't impossible to figure out.