Skip to content

Commit

Permalink
Add examples to README
Browse files Browse the repository at this point in the history
  • Loading branch information
Etienne Tripier committed Jul 13, 2017
1 parent 3b2bc9e commit 7ad0516
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@ Call `preload` when defining your field:
# Post.includes(:comments)
preload :comments

# Post.includes(:comments, :authors)
preload [:comments, :authors]

# Post.includes(:comments, authors: [:posts, :followers])
preload [:comments, { authors: [:posts, :followers] }]

resolve ->(obj, args, ctx) { obj.comments }
end
end
Expand Down

0 comments on commit 7ad0516

Please sign in to comment.