selfprivacy-rest-api/selfprivacy_api/graphql/schema.py

35 lines
822 B
Python
Raw Normal View History

2022-06-24 17:12:32 +00:00
"""GraphQL API for SelfPrivacy."""
# pylint: disable=too-few-public-methods
import typing
import strawberry
2022-06-29 17:39:46 +00:00
from selfprivacy_api.graphql import IsAuthenticated
from selfprivacy_api.graphql.mutations.api_mutations import ApiMutations
2022-06-24 17:12:32 +00:00
2022-06-29 17:39:46 +00:00
from selfprivacy_api.graphql.queries.api_queries import Api
2022-06-24 17:12:32 +00:00
from selfprivacy_api.graphql.queries.system import System
@strawberry.type
class Query:
"""Root schema for queries"""
2022-06-24 18:14:20 +00:00
2022-06-29 17:39:46 +00:00
@strawberry.field(permission_classes=[IsAuthenticated])
2022-06-24 18:18:21 +00:00
def system(self) -> System:
"""System queries"""
return System()
2022-06-24 18:14:20 +00:00
2022-06-24 17:12:32 +00:00
@strawberry.field
def api(self) -> Api:
"""API access status"""
return Api()
2022-07-07 13:53:19 +00:00
2022-06-29 17:39:46 +00:00
@strawberry.type
class Mutation(ApiMutations):
"""Root schema for mutations"""
2022-07-07 13:53:19 +00:00
2022-06-29 17:39:46 +00:00
pass
2022-06-24 18:14:20 +00:00
2022-07-07 13:53:19 +00:00
2022-06-29 17:39:46 +00:00
schema = strawberry.Schema(query=Query, mutation=Mutation)