Skip to content

Instantly share code, notes, and snippets.

Created Jul 2, 2022
What would you like to do?
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