Merge pull request #403 from eyal0803/patch-2

Update authorization.rst
This commit is contained in:
Syrus Akbary 2018-03-14 23:27:43 -07:00 committed by GitHub
commit e9a40f2ae9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -61,7 +61,7 @@ define a resolve method for that field and return the desired queryset.
from .models import Post
class Query(ObjectType):
all_posts = DjangoFilterConnectionField(CategoryNode)
all_posts = DjangoFilterConnectionField(PostNode)
def resolve_all_posts(self, args, info):
return Post.objects.filter(published=True)
@ -79,7 +79,7 @@ with the context argument.
from .models import Post
class Query(ObjectType):
my_posts = DjangoFilterConnectionField(CategoryNode)
my_posts = DjangoFilterConnectionField(PostNode)
def resolve_my_posts(self, info):
# context will reference to the Django request