P-01
django-graphex
GraphQL for Django, powered by graphql-core and Pydantic. Define your API straight from your models.
The successor to my graphene-django-extras and graphene-django-subscriptions packages, rebuilt from scratch on graphql-core and Pydantic v2, with no DRF, graphene or django-filter. One Meta.model gives a type its query, list and create/update/delete operations, with nested logical filtering, pagination and optional real-time subscriptions over Channels 4.
Key decisions
- Model-first types and mutations, validated with Pydantic v2 and persisted with the Django ORM.
- A single nested
filter:argument withand/or/notand per-field lookups. - Limit/offset, page and keyset cursor pagination with a uniform
results/totalCountshape, plus an automatic N+1 optimizer. - Permission classes, depth and cost limits, and
only_fields/exclude_fieldsas a security boundary. - Optional
[subscriptions]extra for real-time GraphQL over Django Channels 4.
- Python
- Django
- GraphQL
- graphql-core
- Pydantic
- Django Channels
- Python 99%