Added auth
This commit is contained in:
24
api/schema/__init__.py
Normal file
24
api/schema/__init__.py
Normal file
@@ -0,0 +1,24 @@
|
||||
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)
|
||||
Reference in New Issue
Block a user