From 7ad0516a36a874af9e7178cf1c5dd7eb39a7fd0f Mon Sep 17 00:00:00 2001 From: Etienne Tripier Date: Wed, 12 Jul 2017 20:10:57 -0700 Subject: [PATCH] Add examples to README --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index bcd558e..cf4ab46 100644 --- a/README.md +++ b/README.md @@ -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