INNER CODE UNIT · Python
BookEntity
phalt/django-api-domains · example_domain/apis.py:23
class BookEntity(ObjectType):
class Meta:
interfaces = (relay.Node,)
name = graphene.String()
author_name = graphene.String()
# graphQL mutation
class CreateBook(relay.ClientIDMutation):
class Input:
book_name = graphene.String(required=True)
author_id = graphene.ID(required=True)
book = graphene.Field(BookEntity)
@classmethod
def mutate_and_get_payload(cls, root, info, **input):
new_book = BookService.create_book(