INNER CODE UNIT · Python

Mutation

phalt/django-api-domains · example_domain/apis.py:74

class Mutation:
    create_book = CreateBook.Field()


class Query:
    book = graphene.Field(BookEntity)

    def resolve_book(self, info):
        logger.info(f"graphQL query for book with id {info.get('id')}")
        book = BookService.get_book(id=info.get('id'))
        return BookEntity(
            name=book['name'],
            author_name=book['author_name'],
        )

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…