Apply suggestions from code review

Change resolver examples to use better named arguments

Co-Authored-By: allardhoeve <allardhoeve@gmail.com>
This commit is contained in:
Jonathan Kim 2019-04-30 12:47:52 +02:00 committed by GitHub
parent eb0c2d8e25
commit c38b4d268c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -112,9 +112,9 @@ leaner code and at most 4 database requests, and possibly fewer if there are cac
friends = graphene.List(lambda: User) friends = graphene.List(lambda: User)
@staticmethod @staticmethod
def resolve_best_friend(root, info): def resolve_best_friend(user, info):
return user_loader.load(root.best_friend_id) return user_loader.load(root.best_friend_id)
@staticmethod @staticmethod
def resolve_friends(root, info): def resolve_friends(user, info):
return user_loader.load_many(root.friend_ids) return user_loader.load_many(root.friend_ids)

View File

@ -42,5 +42,5 @@ that implements ``Node`` will have a default Connection.
ships = relay.ConnectionField(ShipConnection) ships = relay.ConnectionField(ShipConnection)
@staticmethod @staticmethod
def resolve_ships(root, info): def resolve_ships(faction, info):
return [] return []