mirror of
https://github.com/rjNemo/graphql_python_template
synced 2026-06-06 10:36:40 +00:00
15 lines
393 B
Python
15 lines
393 B
Python
import graphene
|
|
|
|
from app.schema.types.user import UserResponseField
|
|
from app.usecases.user import create_user
|
|
|
|
|
|
class CreateUser(graphene.Mutation):
|
|
class Arguments:
|
|
username = graphene.String()
|
|
|
|
result = graphene.Field(UserResponseField)
|
|
|
|
def mutate(self, info, username: str):
|
|
user = create_user(username)
|
|
return CreateUser(UserResponseField(user=user))
|