Quickstart
Install the package:
uv add lexigram-graphqlMinimal example
Section titled “Minimal example”import asyncioimport strawberryfrom lexigram import Applicationfrom lexigram.graphql import GraphQLModule
@strawberry.typeclass Query: @strawberry.field def hello(self) -> str: return "world"
async def main() -> None: app = Application(name="my-app") app.add_module(GraphQLModule.configure(query_class=Query)) async with Application.boot(name="my-app", modules=[GraphQLModule.configure(query_class=Query)]) as app: from lexigram.contracts.graphql import GraphQLExecutorProtocol
executor = await app.container.resolve(GraphQLExecutorProtocol) result = await executor.execute("{ hello }") if result.is_ok(): print(result.unwrap()["data"]) # {'hello': 'world'}
asyncio.run(main())What just happened
Section titled “What just happened”GraphQLModule.configure()registered the GraphQL provider, schema builder, and executor in the container- The root
Querytype was attached to the schema GraphQLExecutorProtocol.execute()ran the query through the Strawberry execution pipeline
Next steps
Section titled “Next steps”- Guide — schema design, mutations, subscriptions, security
- Architecture — provider, contracts, extensions, lifecycle
- Configuration — depth limits, caching, subscriptions, introspection
- How-Tos — resolvers, dataloaders, federation, persisted queries