Skip to content

Commit

Permalink
Merge pull request #283 from TheBlusky/patch-1
Browse files Browse the repository at this point in the history
Update authorization.rst
  • Loading branch information
syrusakbary authored Oct 9, 2017
2 parents f35e445 + 9c9cef4 commit 31085d8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions docs/authorization.rst
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,12 @@ with the context argument.
class Query(ObjectType):
my_posts = DjangoFilterConnectionField(CategoryNode)
def resolve_my_posts(self, args, context, info):
def resolve_my_posts(self, info):
# context will reference to the Django request
if not context.user.is_authenticated():
if not info.context.user.is_authenticated():
return Post.objects.none()
else:
return Post.objects.filter(owner=context.user)
return Post.objects.filter(owner=info.context.user)
If you're using your own view, passing the request context into the
schema is simple.
Expand Down

0 comments on commit 31085d8

Please sign in to comment.