Skip to content

Instantly share code, notes, and snippets.

@Bijitakc
Created July 2, 2022 18:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Bijitakc/006c7fa5a1297023ccada9dd5dd75719 to your computer and use it in GitHub Desktop.
Save Bijitakc/006c7fa5a1297023ccada9dd5dd75719 to your computer and use it in GitHub Desktop.
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