INIT Commit

This commit is contained in:
Michal Kváček
2023-06-05 09:55:17 +02:00
commit 014a999055
46 changed files with 1645 additions and 0 deletions
+17
View File
@@ -0,0 +1,17 @@
from typing import List
import strawberry
from sqlalchemy import select
from database.models import Copilot
from graphql_schema.sqlalchemy_to_strawberry_type import strawberry_sqlalchemy_type
@strawberry_sqlalchemy_type(Copilot)
class CopilotType:
pass
@strawberry.type
class CopilotQueries:
@strawberry.field
async def pilots(root, info) -> List[CopilotType]:
return (await info.context['db'].scalars(select(Copilot))).all()