graphql-server is a Python library that provides integrations for setting up GraphQL servers in various web frameworks such as Flask, Starlette, Django, and Sanic. It currently includes version 3.0.0, which acts as a meta-package bundling core server logic and framework-specific adapters. Releases are made as needed, often in conjunction with updates to its underlying `graphql-core` and framework integration packages.
pip install graphql-serverVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates setting up a basic GraphQL server with Starlette and `graphql-server-starlette`. It defines a simple schema using `graphene`, then exposes it via `GraphQLRouter` at `/graphql` and a GraphQL Playground UI at `/graphql-playground`. You'll need `starlette`, `uvicorn`, `graphene`, and `graphql-server` installed.
Update your import statements to point to the correct framework-specific submodule, such as `graphql_server.flask`, `graphql_server.starlette`, or `graphql_server.django`.
For smaller deployments or to manage dependencies more precisely, install only the specific framework integration package you intend to use (e.g., `pip install graphql-server-starlette`).
Always define a valid `graphene.Schema` object or similar schema representation and pass it to your `GraphQLView` or `GraphQLRouter` instance. Check `graphql-core` and `graphene` documentation for schema building best practices.