25 lines
661 B
Python
25 lines
661 B
Python
import strawberry
|
|
|
|
from api.schema.definitions.auth import AuthResult
|
|
from api.schema.definitions.auth import login
|
|
from api.schema.definitions.auth import update_me
|
|
from api.schema.definitions.common import CommonMessage
|
|
from api.schema.extensions import extensions
|
|
from api.schema.permissions import IsAuthenticated
|
|
|
|
|
|
@strawberry.type
|
|
class Query:
|
|
hello: str
|
|
|
|
|
|
@strawberry.type
|
|
class Mutation:
|
|
login: AuthResult = strawberry.field(resolver=login)
|
|
update_me: CommonMessage = strawberry.field(
|
|
resolver=update_me, permission_classes=[IsAuthenticated]
|
|
)
|
|
|
|
|
|
schema = strawberry.Schema(query=Query, mutation=Mutation, extensions=extensions)
|