Registry / web-framework / graphql-server

graphql-server

JSON →
library3.0.0pypypiunverified

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-server
INSTALL
IMPORT
SIG · GRAPHQL-SERVER
G
graphql-server
web-frameworkpythonv3.0.0
Install
Import
Disk
Pass rate
0/ 10
Env Coverage0 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v3.0.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
glibc
py 3.10
2/4 runs
2/4 runs
py 3.11
2/4 runs
2/4 runs
py 3.12
2/4 runs
2/4 runs
py 3.13
2/4 runs
2/4 runs
py 3.9
2/4 runs
2/4 runs
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

GraphQLRouter
from graphql_server import GraphQLRouter
from graphql_server import GraphQLRouter

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.

import graphene from starlette.applications import Starlette from starlette.responses import JSONResponse from starlette.routing import Route from graphql_server.starlette import GraphQLRouter # 1. Define your GraphQL schema using Graphene class Query(graphene.ObjectType): hello = graphene.String(name=graphene.String(default_value="World")) def resolve_hello(self, info, name): return f"Hello, {name}!" schema = graphene.Schema(query=Query) # 2. Integrate with Starlette using GraphQLRouter async def homepage(request): return JSONResponse({"message": "Visit /graphql for the API or /graphql-playground for the UI."}) routes = [ Route("/", homepage), Route("/graphql", GraphQLRouter(schema)), Route("/graphql-playground", GraphQLRouter(schema, playground=True)) ] app = Starlette(routes=routes) # To run this app, save it as `app.py` and execute: # uvicorn app:app --reload # Then visit http://127.0.0.1:8000/graphql-playground in your browser.
Debug
Known issues
breakingVersion 3.x of `graphql-server` is a meta-package; direct imports like `from graphql_server import GraphQLView` are no longer valid. Instead, you must import from framework-specific submodules (e.g., `from graphql_server.flask import GraphQLView`).
fix
Update your import statements to point to the correct framework-specific submodule, such as `graphql_server.flask`, `graphql_server.starlette`, or `graphql_server.django`.
affects: >=3.0.0
gotchaInstalling `graphql-server` installs all framework integrations by default. If you only need one (e.g., for Flask), it's more efficient to install the specific package (e.g., `pip install graphql-server-flask`).
fix
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`).
affects: >=3.0.0
gotchaGraphQL Server for Python relies on `graphql-core` for the underlying GraphQL implementation and `graphene` (or similar) for schema definition. Ensure these dependencies are correctly installed and your schema is properly constructed.
fix
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.
affects: All
Upgrade
Version history
3.0.0latest on PyPI · released Aug 17, 2025
Audit
Dependencies
graphql-corerequiredProvides the core GraphQL execution logic.
grapheneoptionalCommonly used for building GraphQL schemas, though not a strict dependency of graphql-server itself.
starletteoptionalRequired for `graphql-server-starlette` integration.
flaskoptionalRequired for `graphql-server-flask` integration.
Agent activity
23 hits · last 30 days
node
22
Resources
graphql-server — pip install graphql-server · libregistry