skillbox/server/notes/schema.py

26 lines
533 B
Python

import graphene
from graphene import relay
from graphene_django import DjangoObjectType
from notes.models import Note, ContentBlockBookmark
class NoteNode(DjangoObjectType):
pk = graphene.Int()
class Meta:
model = Note
interfaces = (relay.Node,)
def resolve_pk(self, *args, **kwargs):
return self.id
class ContentBlockBookmarkNode(DjangoObjectType):
# note = graphene.
uuid = graphene.UUID()
note = graphene.Field(NoteNode)
class Meta:
model = ContentBlockBookmark