mirror of
https://github.com/graphql-python/graphene.git
synced 2025-02-23 23:20:47 +03:00
Return an empty queryset instead of an empty list
This commit is contained in:
parent
72411e559f
commit
fa9b7922a1
|
@ -75,7 +75,7 @@ class Query(ObjectType):
|
||||||
def resolve_my_posts(self, args, context, info):
|
def resolve_my_posts(self, args, context, info):
|
||||||
# context will reference to the Django request
|
# context will reference to the Django request
|
||||||
if not context.user.is_authenticated():
|
if not context.user.is_authenticated():
|
||||||
return []
|
return Post.objects.none()
|
||||||
else:
|
else:
|
||||||
return Post.objects.filter(owner=context.user)
|
return Post.objects.filter(owner=context.user)
|
||||||
```
|
```
|
||||||
|
|
Loading…
Reference in New Issue
Block a user