From c38b4d268c20d044fbc1e6e676637acb4c2d27fd Mon Sep 17 00:00:00 2001 From: Jonathan Kim Date: Tue, 30 Apr 2019 12:47:52 +0200 Subject: [PATCH] Apply suggestions from code review Change resolver examples to use better named arguments Co-Authored-By: allardhoeve --- docs/execution/dataloader.rst | 4 ++-- docs/relay/connection.rst | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/execution/dataloader.rst b/docs/execution/dataloader.rst index 16d3a1fb..07fbad17 100644 --- a/docs/execution/dataloader.rst +++ b/docs/execution/dataloader.rst @@ -112,9 +112,9 @@ leaner code and at most 4 database requests, and possibly fewer if there are cac friends = graphene.List(lambda: User) @staticmethod - def resolve_best_friend(root, info): + def resolve_best_friend(user, info): return user_loader.load(root.best_friend_id) @staticmethod - def resolve_friends(root, info): + def resolve_friends(user, info): return user_loader.load_many(root.friend_ids) diff --git a/docs/relay/connection.rst b/docs/relay/connection.rst index 8ff1d9fe..70c99213 100644 --- a/docs/relay/connection.rst +++ b/docs/relay/connection.rst @@ -42,5 +42,5 @@ that implements ``Node`` will have a default Connection. ships = relay.ConnectionField(ShipConnection) @staticmethod - def resolve_ships(root, info): + def resolve_ships(faction, info): return []