Tag: fastapi
-
POST body not visible in OpenAPI for GraphQL route
-1 I have a FastAPI app with Strawberry for GraphQL. This is a minimal, workable example: main.py: import strawberry from fastapi import FastAPI from strawberry.fastapi import GraphQLRouter @strawberry.type class User: name: str age: int @strawberry.type class Query: @strawberry.field def user(self) -> User: return User(name="Patrick", age=100) schema = strawberry.Schema(query=Query) graphql_app = GraphQLRouter(schema) app = FastAPI() app.include_router(graphql_app,…
-
Circular Import Strawberry
0 Hi I am trying to make a GraphQL API using FastAPI and Strawberry and could not figure out how to do this. Essentially here is my problem: I have one model (call it Department) that has a one to many relationship with the Employee model, so that department.employees is the list of all employees…
-
is it possible to have a single subscription waiting for data from multiple sources using graphql strawberry?
0 I am expecting to get data from multiple sources via single subscription if the data is not available in the source yield empty response, for certain number of retries @strawberry.type class DataFromSources: source_1 : JSON source_2 : JSON @strawberry.type class Subscription: @strawberry.subscription async def data_from_sources(self, target: int = 10) -> AsyncGenerator[DataFromSources, None]: source_1, source_2…