mirror of
https://github.com/rjNemo/graphql_python_template
synced 2026-06-06 10:36:40 +00:00
15 lines
No EOL
355 B
Python
15 lines
No EOL
355 B
Python
import graphene
|
|
|
|
from app.schema.types.todo import TodoType
|
|
from app.usecases import create_todo
|
|
|
|
|
|
class CreateTodo(graphene.Mutation):
|
|
class Arguments:
|
|
title = graphene.String(default_value="")
|
|
|
|
todo = graphene.Field(TodoType)
|
|
|
|
def mutate(self, info, title: str):
|
|
todo = create_todo(title)
|
|
return CreateTodo(todo=todo) |