INIT Commit
This commit is contained in:
@@ -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()
|
||||
Reference in New Issue
Block a user