Skip to content

Commit 31085d8

Browse files
authored
Merge pull request #283 from TheBlusky/patch-1
Update authorization.rst
2 parents f35e445 + 9c9cef4 commit 31085d8

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

docs/authorization.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,12 +81,12 @@ with the context argument.
8181
class Query(ObjectType):
8282
my_posts = DjangoFilterConnectionField(CategoryNode)
8383
84-
def resolve_my_posts(self, args, context, info):
84+
def resolve_my_posts(self, info):
8585
# context will reference to the Django request
86-
if not context.user.is_authenticated():
86+
if not info.context.user.is_authenticated():
8787
return Post.objects.none()
8888
else:
89-
return Post.objects.filter(owner=context.user)
89+
return Post.objects.filter(owner=info.context.user)
9090
9191
If you're using your own view, passing the request context into the
9292
schema is simple.

0 commit comments

Comments
 (0)