import graphene
from graphene import relay

from api.graphene_wagtail import GenericStreamFieldType


class ContentBlockInterface(graphene.Interface):
    title = graphene.String()
    contents = GenericStreamFieldType()
    type = graphene.String()

    @staticmethod
    def resolve_type(parent, info, **kwargs):
        return parent.type
