Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for GraphQLRouter (0.05 sec)

  1. docs_src/graphql_/tutorial001_py39.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()
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Fri Dec 26 10:43:02 UTC 2025
    - 424 bytes
    - Viewed (0)
Back to top