absinthe-graphql / absinthe_ecto

DEPRECATED: Use dataloader
MIT License
130 stars 36 forks source link

perform_has_many_through implemented #6

Closed diegonogueira closed 7 years ago

diegonogueira commented 7 years ago

I implemented a possible solution for has_many through. :)

tapickell commented 7 years ago

@diegonogueira Is this how a developer would use this in the schema/types on one of the objects associated in a join_through ?

object :stack do
    ...
    field :team_members, list_of(:team_member), resolve: assoc(:team_members_stacks)
end
diegonogueira commented 7 years ago

Yes @tapickell. You can use like has_many :)

diegonogueira commented 7 years ago

@tapickell You can use something like this:

object :stack do
    ...
    field :team_members, list_of(:team_member), resolve: assoc(:team_members)
end
tapickell commented 7 years ago

@diegonogueira thanks I am able to move forward using your fork until a solution is merged into master. :+1:

benwilson512 commented 7 years ago

Hey! I appreciate the PR, but in the end I think we're going to try to just leverage the functions that Ecto gives us to handle this instead of re-creating a bunch of ecto logic, which is what this path (and the path I was originally on) are gonna end up having to do.