Closed avitex closed 7 years ago
This is an interesting proposal. Do note that with the merge of #5 this can be handled by having an ecto association on your schema that specifies the through
assocations themselves.
Wouldnt the recursive walk_assoc
create some cascading batches ? It seems like it would be better to leverage Ecto.assoc/2
to handle dynamically loading through associations unless behind the scene Ecto will actually generate the same amount of queries.
Closing this as stale (and possibly superseded by #11).
For database structures that aren't so clear cut, or at least what I've currently experienced, the ability to specify a path to the association would be pretty useful.
I did consider adding the ability to load associations along the path that it meets aren't loaded, however, I didn't implement this as I think it would potentially be bad practice, as it treads on absinthe/graphql concerns as the one handling the loading of the tree of associations.
I also considered, rather than providing a path, allowing the user to pass an anonymous function to do the resolving themselves, but they would then need to handle the absence of a child themselves.
If you think different, I'll happily implement it! :)
For an example, consider this type of structure: