Skip to content

Commit

Permalink
Update GraphQL readme examples
Browse files Browse the repository at this point in the history
  • Loading branch information
exAspArk committed Mar 14, 2021
1 parent bc6e83a commit d962df7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ module Types
field :user, UserType, null: false

def user
post.user # N+1 queries
object.user # N+1 queries
end
end
end
Expand Down Expand Up @@ -295,7 +295,7 @@ module Types
field :user, UserType, null: false

def user
BatchLoader::GraphQL.for(post.user_id).batch do |user_ids, loader|
BatchLoader::GraphQL.for(object.user_id).batch do |user_ids, loader|
User.where(id: user_ids).each { |user| loader.call(user.id, user) }
end
end
Expand Down

0 comments on commit d962df7

Please sign in to comment.