{"id":5637,"library":"graphql-server-core","title":"GraphQL Server Core","description":"graphql-server-core is a Python library that provides the core logic and utilities for building a GraphQL server, compatible with graphql-core. It handles request parsing, execution, and error formatting, acting as a foundation for framework-specific integrations. The current stable version is 2.0.0, but development has largely shifted to its successor, 'graphql-server' (v3.x).","status":"maintenance","version":"2.0.0","language":"en","source_language":"en","source_url":"https://github.com/graphql-python/graphql-server-core","tags":["graphql","server","core","deprecated","wsgi","asgi"],"install":[{"cmd":"pip install graphql-server-core","lang":"bash","label":"Install stable version"}],"dependencies":[{"reason":"Core GraphQL execution engine. Version 2.0.0 requires graphql-core>=3.1,<3.2.","package":"graphql-core","optional":false}],"imports":[{"note":"This function is used to create a basic WSGI/ASGI-compatible GraphQL application handler.","symbol":"create_app","correct":"from graphql_server_core import create_app"},{"symbol":"GraphQLResponse","correct":"from graphql_server_core import GraphQLResponse"},{"symbol":"format_error","correct":"from graphql_server_core.errors import format_error"}],"quickstart":{"code":"from graphql import build_schema\nfrom graphql_server_core import create_app\n\ndef resolve_hello(root, info):\n    return 'Hello from GraphQL-Server-Core!'\n\n# Define your GraphQL schema\nschema = build_schema('''\n    type Query {\n        hello: String\n    }\n''')\n\n# Attach a resolver to the 'hello' field\nschema.query.set_field('hello', resolve_hello)\n\n# Create a basic GraphQL application handler\n# For actual serving, this `app` object would be integrated with a WSGI/ASGI server\n# e.g., using Flask or FastAPI, which would require separate packages\napp = create_app(\n    schema=schema,\n    pretty=True, # Optional: format output nicely\n    enable_graphiql=False # Optional: disable GraphiQL interface\n)\n\n# Example of how to simulate a request (for demonstration, not a full server)\n# In a real application, a web framework would handle the request/response cycle.\n# This library primarily provides the 'app' handler.\n# print(\"App handler created, integrate with a web framework to serve.\")\n","lang":"python","description":"This quickstart demonstrates how to initialize a basic GraphQL application handler using `create_app`. For a fully functional server, this handler needs to be integrated with a web framework (like Flask, Django, etc.), which, for `graphql-server-core` v2.x, typically required additional framework-specific packages (e.g., `graphql-server-flask`)."},"warnings":[{"fix":"It is highly recommended to migrate to `graphql-server` (v3.x) for new projects and consider migration for existing `graphql-server-core` projects. The import paths and API for framework integration will differ significantly. Refer to the `graphql-server` documentation.","message":"The `graphql-server-core` package (v2.x) has been effectively superseded by `graphql-server` (v3.x). `graphql-server` is a refactored and consolidated library that bundles all framework integrations (Flask, Aiohttp, Sanic, etc.) directly into a single package, simplifying dependencies and usage.","severity":"breaking","affected_versions":"All versions of graphql-server-core (up to 2.x)"},{"fix":"Plan to use `graphql-server` (v3.x) instead, which provides a more modern and integrated solution for building GraphQL servers in Python.","message":"This `graphql-server-core` library is considered to be in maintenance mode, with active development having shifted to its successor, `graphql-server` (v3.x). While functional, it may not receive new features or extensive updates.","severity":"deprecated","affected_versions":"All versions of graphql-server-core"},{"fix":"If sticking with `graphql-server-core` v2.x, ensure you install the correct framework-specific integration package for your chosen web framework (e.g., `pip install graphql-server-flask`). If migrating, note that `graphql-server` v3.x handles these integrations differently and usually doesn't require separate `graphql-server-` packages.","message":"For `graphql-server-core` v2.x, integrating with specific web frameworks (like Flask or Aiohttp) required installing separate companion packages (e.g., `graphql-server-flask`, `graphql-server-aiohttp`). This is unlike `graphql-server` v3.x, where framework integrations are bundled.","severity":"gotcha","affected_versions":"graphql-server-core <= 2.0.0"},{"fix":"Ensure your environment has `graphql-core` installed within the specified range. If you need to use a newer `graphql-core` version (e.g., `3.2.x` or higher), you will likely need to migrate to `graphql-server` v3.x, which is built on a more recent `graphql-core` foundation.","message":"`graphql-server-core` v2.x specifically depends on `graphql-core>=3.1,<3.2`. Incompatibilities can arise if using other versions of `graphql-core`.","severity":"gotcha","affected_versions":"graphql-server-core <= 2.0.0"}],"env_vars":null,"last_verified":"2026-04-12T00:00:00.000Z","next_check":"2026-07-11T00:00:00.000Z"}