{"id":2389,"library":"ariadne","title":"Ariadne","description":"Ariadne is a Python library for implementing GraphQL servers using a schema-first approach. It emphasizes a simple, extensible API for defining GraphQL schemas using Schema Definition Language (SDL) and connecting business logic with minimal boilerplate. It supports queries, mutations, subscriptions, custom scalars, and integrates with ASGI/WSGI frameworks like Django, FastAPI, Flask, and Starlette. The project maintains an active and frequent release cadence, with regular patch, minor, and occasional alpha releases, as seen with versions like 1.0.1 and subsequent 1.1.0a2.","status":"active","version":"1.0.1","language":"en","source_language":"en","source_url":"https://github.com/mirumee/ariadne","tags":["GraphQL","server","schema-first","ASGI","WSGI","API","web"],"install":[{"cmd":"pip install ariadne uvicorn","lang":"bash","label":"Install Ariadne and Uvicorn (ASGI server for quickstart)"}],"dependencies":[{"reason":"Required runtime environment.","package":"Python","version":">=3.10"}],"imports":[{"note":"Used to parse GraphQL Schema Definition Language (SDL) strings.","symbol":"gql","correct":"from ariadne import gql"},{"note":"Used to define resolvers for queries.","symbol":"QueryType","correct":"from ariadne import QueryType"},{"note":"Combines schema definitions and resolvers into a runnable GraphQL schema.","symbol":"make_executable_schema","correct":"from ariadne import make_executable_schema"},{"note":"Provides a convenient development server with GraphiQL explorer. For production, integrate with ASGI/WSGI frameworks like FastAPI or Flask.","symbol":"start_dev_server","correct":"from ariadne import start_dev_server"}],"quickstart":{"code":"from ariadne import gql, QueryType, make_executable_schema, start_dev_server\n\n# Define GraphQL schema using Schema Definition Language (SDL)\ntype_defs = gql(\"\"\"\n    type Query {\n        people: [Person!]!\n    }\n\n    type Person {\n        firstName: String!\n        lastName: String!\n    }\n\"\"\")\n\n# Create a QueryType instance to define query resolvers\nquery = QueryType()\n\n# Define the resolver for the 'people' field\n@query.field(\"people\")\ndef resolve_people(*_):\n    return [\n        {\"firstName\": \"John\", \"lastName\": \"Doe\"},\n        {\"firstName\": \"Jane\", \"lastName\": \"Smith\"},\n    ]\n\n# Combine type definitions and resolvers into an executable schema\nschema = make_executable_schema(type_defs, query)\n\n# Run the development server\nif __name__ == \"__main__\":\n    # Access the GraphQL endpoint and GraphiQL at http://127.0.0.1:8000\n    start_dev_server(schema, port=8000)\n","lang":"python","description":"This quickstart sets up a basic Ariadne GraphQL server with a 'Person' type and a 'people' query. It defines the schema in SDL, creates a resolver for the 'people' field, and runs a development server with GraphiQL for interactive API exploration."},"warnings":[{"fix":"Consult the official migration guide (linked in GitHub release notes for 1.0.0) to update your codebase. Replace removed functionalities with their modern equivalents or adjust naming conventions.","message":"Version 1.0.0 introduced several breaking changes including the removal of deprecated `EnumType.bind_to_default_values`, Apollo tracing, OpenTracing, and `extend_federated_schema`. It also made base handler class names consistent and adjusted `convert_names_case` behavior.","severity":"breaking","affected_versions":"1.0.0+"},{"fix":"Migrate from `FallbackResolvers` to standard resolver patterns. If you relied on `convert_kwargs_to_snake_case` for automatic argument case conversion, you will need to implement this conversion manually in your resolvers or use other utility functions if available in newer versions.","message":"In version 0.29.0, deprecated utilities `FallbackResolvers` and `convert_kwargs_to_snake_case` were removed, along with legacy code paths for versions prior to 0.20.","severity":"breaking","affected_versions":"0.29.0+"},{"fix":"For user-facing errors, define custom fields within your GraphQL types (e.g., `type Mutation { login(data: LoginInput): LoginPayload } type LoginPayload { user: User error: String }`) to return specific error messages as part of the data payload.","message":"The `errors` key in GraphQL responses is intended for technical errors (e.g., parsing, validation, execution issues), not for communicating application-level business logic errors (like permission denied or validation failures to end-users).","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-10T00:00:00.000Z","next_check":"2026-07-09T00:00:00.000Z"}