Created
July 2, 2022 18:37
-
-
Save Bijitakc/006c7fa5a1297023ccada9dd5dd75719 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import graphene | |
from graphene_django import DjangoListField | |
from .models import Post | |
from .types import PostType | |
class Query(graphene.ObjectType): | |
all_posts = DjangoListField(PostType) | |
def resolve_all_posts(root, info): | |
return Post.objects.all() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment