NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
PyPI · #2870 most downloaded on PyPI
Strawberry GraphQL Django extension
Last release today
04 Oct 2026
Ships fairly regularly
a new release about every 3 weeks
Nearly every release is documented
notes for 59 of the last 60 stable releases
1 version withdrawn
withdrawn after publishing
6 years old
203 releases · first in 2020
One column per quarter.
Nothing published for this version
See Strawberry's 0.328.0 breaking changes for the graphql-core 3.3 changes to error messages and schema printing.
Require strawberry-graphql>=0.328.0, which requires graphql-core>=3.3.0.
strawberry_django.utils.IS_GQL_32 and IS_GQL_33.StrawberryDjangoField.get_result returns an unevaluated QuerySet for list fields. graphql-core fetches it while completing the list, using async for in async execution.StrawberryDjangoField.disable_fetch_list_results attribute.See Strawberry's 0.328.0 breaking changes for the graphql-core 3.3 changes to error messages and schema printing.
This release was contributed by @bellini666 in #965
Coordinate arrays keep working, so this is not a breaking change.
All GeoDjango geometry scalars now accept WKT, EWKT, HEXEWKB and GeoJSON (as a string or an object) as input.
Before, the geometry-specific scalars (Point, LineString, LinearRing, Polygon, MultiPoint, MultiLineString and MultiPolygon) only accepted coordinate arrays, and the Geometry scalar, also used by the spatial filter lookups, only accepted strings. Coordinate arrays keep working, so this is not a breaking change.
mutation {
createLocation(
data: {
point: "SRID=4326;POINT(2.2945 48.8584)"
area: {
type: "Polygon"
coordinates: [[[0, 0], [0, 10], [10, 10], [10, 0], [0, 0]]]
}
}
) {
id
}
}The geometry type must match the scalar (e.g. a Point doesn't accept a POLYGON), and geometries with a different SRID are transformed to the field's SRID.
This release was contributed by @shmoon-kr in #963
Additional contributors: @pre-commit-ci[bot]
Fix an N+1 query regression when a field declares a prefetch_related hint and its resolver returns the prefetched related manager's queryset, for exam
Fix an N+1 query regression when a field declares a prefetch_related hint and its resolver returns the prefetched related manager's queryset, for example:
@strawberry_django.type(Author)
class AuthorType:
@strawberry_django.field(prefetch_related=["books"])
def books(self) -> list[BookType]:
return self.books.all()If the related model had no default Meta.ordering, the deterministic ordering added in 0.57.0 applied .order_by("pk") to the already evaluated queryset. That threw away the prefetched results and ran one extra query per parent. Querysets that have already been evaluated are no longer re-ordered.
This release was contributed by @kymckay in #964
Additional contributors: @cursoragent
Add GeometryFilterLookup , which adds spatial lookups to the filters of GeoDjango geometry fields.
Add GeometryFilterLookup, which adds spatial lookups to the filters of GeoDjango geometry fields.
When GeoDjango is installed, filters created with lookups=True use GeometryFilterLookup for geometry fields (PointField, PolygonField, GeometryField, etc.). It includes exact, isNull and the spatial lookups supported by every GeoDjango backend: contains, disjoint, equals, intersects, overlaps, touches and within.
@strawberry_django.filter_type(models.Place, lookups=True)
class PlaceFilter:
location: autoquery {
places(
filters: { location: { within: "POLYGON((0 0, 0 10, 10 10, 10 0, 0 0))" } }
) {
id
}
}This release was contributed by @shmoon-kr in #960
Fix nullable connections (e.g. when guarded by a permission extension) eagerly fetching the entire table before the connection applied its pagination.
Fix nullable connections (e.g. when guarded by a permission extension) eagerly
fetching the entire table before the connection applied its pagination. The
return type is now unwrapped from StrawberryOptional/other containers so the
queryset evaluation stays deferred and the connection can apply a LIMIT.
This release was contributed by @rcybulski1122012 in #953
Permission extensions are now fully compatible with strawberry-graphql >= 0.326.0 , which enforces strict type uniqueness for custom schema directives
Permission extensions are now fully compatible with strawberry-graphql >= 0.326.0, which enforces strict type uniqueness for custom schema directives during schema construction.
Previously, DjangoPermissionExtension.schema_directive created a new anonymous AutoDirective class on every extension instantiation without caching it on the underlying class.
When the same permission extension (e.g. IsSuperuser(), IsAuthenticated(), or custom subclasses) was attached to multiple fields, Strawberry raised a ValueError reporting duplicate directive definitions for the same directive name.
The generated AutoDirective class is now cached on self.__class__ via __dict__.get():
@functools.cached_property
def schema_directive(self) -> object:
key = "__strawberry_directive_type__"
directive_class = self.__class__.__dict__.get(key)
if directive_class is None:
@schema_directive(
name=self.__class__.__name__,
locations=self.SCHEMA_DIRECTIVE_LOCATIONS,
description=self.SCHEMA_DIRECTIVE_DESCRIPTION,
repeatable=True,
)
class AutoDirective: ...
directive_class = AutoDirective
setattr(self.__class__, key, directive_class)
return directive_class()This ensures a single, reusable schema directive type is created per extension class, eliminating duplicate directive collisions while preserving full isolation across subclasses and maintaining backward compatibility with older Strawberry versions.
This release was contributed by @daudln in #951
Additional contributors: @pre-commit-ci[bot], @Copilot, @bellini666
Require Strawberry GraphQL 0.322.2 or newer, which fixes Relay pagination when combining first with before . Update compatibility tests for the correc
Require Strawberry GraphQL 0.322.2 or newer, which fixes Relay pagination when combining first with before. Update compatibility tests for the corrected pagination behavior and make schema comparisons independent of top-level definition order.
Update GraphQL-core 3.3 compatibility for the 3.3.0rc0 execution API, preserving resolve-info context and adapting fragment and variable values used by the query optimizer.
This release was contributed by @patrick91 in #955
Additional contributors: @pre-commit-ci[bot]
Permission extensions are now fully compatible with strawberry-graphql >= 0.326.0 , which enforces strict type uniqueness for custom schema directives
Permission extensions are now fully compatible with strawberry-graphql >= 0.326.0, which enforces strict type uniqueness for custom schema directives during schema construction.
Previously, DjangoPermissionExtension.schema_directive created a new anonymous AutoDirective class on every extension instantiation without caching it on the underlying class.
When the same permission extension (e.g. IsSuperuser(), IsAuthenticated(), or custom subclasses) was attached to multiple fields, Strawberry raised a ValueError reporting duplicate directive definitions for the same directive name.
The generated AutoDirective class is now cached on self.__class__ via __dict__.get():
@functools.cached_property
def schema_directive(self) -> object:
key = "__strawberry_directive_type__"
directive_class = self.__class__.__dict__.get(key)
if directive_class is None:
@schema_directive(
name=self.__class__.__name__,
locations=self.SCHEMA_DIRECTIVE_LOCATIONS,
description=self.SCHEMA_DIRECTIVE_DESCRIPTION,
repeatable=True,
)
class AutoDirective: ...
directive_class = AutoDirective
setattr(self.__class__, key, directive_class)
return directive_class()This ensures a single, reusable schema directive type is created per extension class, eliminating duplicate directive collisions while preserving full isolation across subclasses and maintaining backward compatibility with older Strawberry versions.
This release was contributed by @daudln in #949
Additional contributors: @Copilot, @bellini666, @pre-commit-ci[bot]
Allow mutations with Django error handling to return interfaces by expanding them to their concrete implementations.
Allow mutations with Django error handling to return interfaces by expanding them to their concrete implementations.
This release was contributed by @Guflly in #939
Additional contributors: @bellini666
Fix the query optimizer dropping a manually applied select_related from the only() mask when another field on the same model shares its name as a pref
Fix the query optimizer dropping a manually applied select_related from the
only() mask when another field on the same model shares its name as a
prefix without a __ boundary (e.g. company vs company_branch). This
previously made Django raise FieldError: cannot be both deferred and traversed using select_related at the same time whenever only the longer
sibling was selected in the query.
This release was contributed by @cjcontreras in #945
Resolve prefetch-optimized nested connections on the event loop instead of paying a sync_to_async thread hop per parent node: the nested-connection de
Resolve prefetch-optimized nested connections on the event loop instead of
paying a sync_to_async thread hop per parent node: the nested-connection
default resolver, the queryset hook for prefetch-optimized querysets and
totalCount served from the prefetched window annotation no longer touch
the database, so they no longer need a worker thread.
This release was contributed by @rcybulski1122012 in #932
Additional contributors: @Copilot
The built-in toolbar script is now compatible with django-debug-toolbar 7.0.0, which renders the toolbar inside a shadow DOM by default.
The built-in toolbar script is now compatible with django-debug-toolbar 7.0.0,
which renders the toolbar inside a shadow DOM by default.
Previously, all DOM queries targeted #djDebug directly on the document,
which broke under shadow DOM isolation — querySelector cannot pierce a shadow
boundary.
Using a getDebugElement() helper that locates #djDebug via
the shadow root of its parent element (#djDebugRoot):
function getDebugElement() {
const root = document.getElementById("djDebugRoot");
if (root) {
return (root.shadowRoot || root).querySelector("#djDebug");
}
return document.getElementById("djDebug");
}This also handles the USE_SHADOW_DOM = False fallback gracefully, keeping
backward compatibility with older versions of the toolbar.
This release was contributed by @daudln in #926
Additional contributors: @Copilot, @pre-commit-ci[bot], @bellini666
Honor the DEFAULT_PK_FIELD_NAME setting (and per-field key_attr ) when resolving existing instances in mutation inputs. Previously _parse_pk read the
Honor the DEFAULT_PK_FIELD_NAME setting (and per-field key_attr) when
resolving existing instances in mutation inputs. Previously _parse_pk read the
input value under key_attr but always looked the instance up by pk=, so
relation inputs and bare-id updates that reference an object by a configured
non-pk field raised DoesNotExist or matched the wrong row. Filters already
honored the setting; mutations now do too. The default pk-based path is
unchanged.
Fix an N+1 on totalCount of nested connections optimized by prefetching: parents whose prefetched first-page partition came back empty issued one COUN
Fix an N+1 on totalCount of nested connections optimized by prefetching:
parents whose prefetched first-page partition came back empty issued one
COUNT(*) query each, even though an empty first page already proves the
total count is 0.
This release was contributed by @rcybulski1122012 in #931
Additional contributors: @Copilot
Document the Django validation cache extension and its Django cache backend options.
@strawberry_django.type types no longer overwrite is_type_of methods in superclasses. Instead, the superclass' result will be taken into account as we
@strawberry_django.type types no longer overwrite is_type_of methods in superclasses.
Instead, the superclass' result will be taken into account as well.
This release was contributed by @diesieben07 in #922
Connection resolvers can now be annotated with a QuerySet[Model] return type instead of being forced to widen it to Iterable[Model] :
Connection resolvers can now be annotated with a QuerySet[Model] return type
instead of being forced to widen it to Iterable[Model]:
@strawberry_django.connection(DjangoCursorConnection[FruitType])
@staticmethod
def fruits() -> QuerySet[Fruit]:
return Fruit.objects.all()Previously this raised RelayWrongResolverAnnotationError because Django's
QuerySet[Model] collapses to the bare QuerySet class, which the relay
annotation check did not recognize as iterable.
This release was contributed by @bellini666 in #920
Resolving a Relay node's id no longer goes through sync_to_async on every call. resolve_id / resolve_id_attr now read the primary key directly off the
Resolving a Relay node's id no longer goes through sync_to_async on every call.
resolve_id/resolve_id_attr now read the primary key directly off the in-memory
instance, removing an unnecessary thread hop (and contextvars copy) in async contexts.
The deferred-field fallback still bridges database access safely.
This release was contributed by @bellini666 in #921
Fix offset_paginated fields applying the filter pipeline twice per resolution.
Fix offset_paginated fields applying the filter pipeline twice per resolution.
StrawberryOffsetPaginatedExtension.resolve forwards filters/order/pagination
to the inner resolver (so extensions and custom resolvers can access them), but then
re-applied them on the queryset the resolver returned. Filters, permission filtering
and the optimizer pass all ran twice; for a filter spanning a multivalued relation
the second .filter() duplicated the relation JOINs, which can grow the intermediate
row count quadratically and turn a sub-second query into a multi-minute one.
The queryset returned by the inner resolver is now passed straight to
resolve_paginated, matching the behavior of relay connection fields.
The bare lookup now works; the bracket form still resolves to the same class but emits a DeprecationWarning.
DateFilterLookup, TimeFilterLookup and DatetimeFilterLookup no longer require a type parameter, matching StrFilterLookup. The generated GraphQL input names also lose their type prefix (e.g. DateDateFilterLookup becomes DateFilterLookup).
@strawberry_django.filter_type(models.Project)
class ProjectFilter:
due_date: strawberry_django.DateFilterLookup | None
Migrating:
StrFilterLookup[str], DateFilterLookup[datetime.date], etc. The bare lookup now works; the bracket form still resolves to the same class but emits a DeprecationWarning.DatetimeFilterLookup.date and .time now accept Date / Time values (previously typed as Int, which never matched Django's __date / __time transforms).TimeFilterLookup.date and .time were removed. Django's __date / __time transforms don't apply to TimeField.This release was contributed by @bellini666 in https://github.com/strawberry-graphql/strawberry-django/pull/910
Breaking change: PAGINATION_MAX_LIMIT now defaults to 100 instead of None, so clients can no longer request more than 100 rows in a single page by def…
Breaking change: PAGINATION_MAX_LIMIT now defaults to 100 instead of None, so clients can
no longer request more than 100 rows in a single page by default.
Previously, the cap was off and PAGINATION_DEFAULT_LIMIT only applied when the client omitted the
limit, which let any client send limit: 9999999 and receive the full table in one response.
To restore the old behavior, set PAGINATION_MAX_LIMIT to None in STRAWBERRY_DJANGO
(not recommended for production).
This release was contributed by @bellini666 in https://github.com/strawberry-graphql/strawberry-django/pull/909
Additional contributors: @Copilot
Propagate child-type only= hints through method resolvers that declare the relation via select_related. Previously they were silently dropped, causing
Propagate child-type only= hints through method resolvers that declare the
relation via select_related. Previously they were silently dropped, causing
deferred loads or KeyErrors on descriptors without a deferred-load fallback
(e.g. djmoney.MoneyField) once the parent's select_related reached past a
single hop.
@strawberry_django.type(Child)
class ChildType:
@strawberry_django.field(only=["extra_data"])
def extra(self) -> str:
return self.extra_data
@strawberry_django.type(Parent)
class ParentType:
@strawberry_django.field(select_related=["child", "child__site"])
def child(self) -> ChildType | None:
return self.child
child.extra_data is now included in the parent's first SELECT.
This release was contributed by @bellini666 in https://github.com/strawberry-graphql/strawberry-django/pull/905
Django 4.2 will reach end of support on April 30, 2026
Drop support for Django 4.2.
Drop support for Django 5.0.
Drop support for Django 5.1.
See https://endoflife.date/django
This release was contributed by @p-r-a-v-i-n in https://github.com/strawberry-graphql/strawberry-django/pull/897
Drop support for Django 4.2.
Drop support for Django 5.0.
Drop support for Django 5.1.
This release was contributed by @p-r-a-v-i-n in #897
Fix FieldError when using the optimizer with django-polymorphic models.
Fix FieldError when using the optimizer with django-polymorphic models.
The optimizer now uses the CamelCase model name for polymorphic optimization hints (e.g., ArtProject___field instead of app_label__artproject___field). This ensures that django-polymorphic correctly handles mismatched optimization hints during the realization of mixed querysets by raising an AssertionError (which it catches) instead of an unhandled FieldError. This change also avoids potential name collisions with lowercase reverse relations in multi-table inheritance.
A polymorphic optional dependency extra has been added, which sets the lower limit version to 4.0.0. Install with pip install strawberry-graphql-django[polymorphic] to pull in django-polymorphic.
This release was contributed by @valkrypton in https://github.com/strawberry-graphql/strawberry-django/pull/894
Additional contributors: @bellini666
Fix FieldExtension arguments being silently lost on StrawberryDjangoField.
Fix FieldExtension arguments being silently lost on StrawberryDjangoField.
When a FieldExtension appended arguments to field.arguments in its apply() method, the arguments worked with strawberry.field but silently disappeared with strawberry_django.field. This was because the mixin chain (Pagination → Ordering → Filters → Base) created a new list on every .arguments access, so .append() mutated a temporary copy.
Added a caching arguments property to StrawberryDjangoField so that the first access computes and caches the full arguments list, and subsequent accesses (including .append() from extensions) operate on the same cached list.
This release was contributed by @bellini666 in https://github.com/strawberry-graphql/strawberry-django/pull/892
Fix StrFilterLookup so it can be used without a type parameter (e.g., name: StrFilterLookup | None). Previously this raised TypeError: "StrFilterLooku
Fix StrFilterLookup so it can be used without a type parameter (e.g., name: StrFilterLookup | None). Previously this raised TypeError: "StrFilterLookup" is generic, but no type has been passed at schema build time.
This release was contributed by @bellini666 in https://github.com/strawberry-graphql/strawberry-django/pull/891
Add support for graphql-core 3.3.x alongside existing 3.2.x support.
Add support for graphql-core 3.3.x alongside existing 3.2.x support.
The minimum supported version of strawberry-graphql has been increased to 0.310.1
When using the graphql-core 3.3.x series, the minimum supported version is 3.3.0a12
Thanks @Cito for adding support for overriding custom async iterators on https://github.com/graphql-python/graphql-core/releases/tag/v3.3.0a12
This release was contributed by @bellini666 at https://github.com/strawberry-graphql/strawberry-django/pull/850
Fix docs example for process_filters custom filter method where prefix was missing a trailing __, causing Django FieldError. Also add a UserWarning in
Fix docs example for process_filters custom filter method where prefix was missing a trailing __, causing Django FieldError. Also add a UserWarning in process_filters() when a non-empty prefix doesn't end with __ to help users catch this mistake early.
This release was contributed by @Ckk3 in https://github.com/strawberry-graphql/strawberry-django/pull/883
Fix FK _id fields (e.g. color_id: auto) in input types failing with mutations.create(). Previously, prepare_create_update() didn't recognize FK attnam
Fix FK _id fields (e.g. color_id: auto) in input types failing with mutations.create(). Previously, prepare_create_update() didn't recognize FK attnames, causing the value to be silently dropped and full_clean() to fail. Now attname fields are mapped and their raw PK values are passed through directly.
This release was contributed by @bellini666 in https://github.com/strawberry-graphql/strawberry-django/pull/880
This is technically a breaking change because the argument type passed to these callables has changed. However, Info acts as a proxy for GraphQLResolv…
Pass Info instead of GraphQLResolveInfo to callables provided in prefetch_related and annotate arguments of strawberry_django.field.
This is technically a breaking change because the argument type passed to these callables has changed. However, Info acts as a proxy for GraphQLResolveInfo and is compatible with the utilities typically used within prefetch or annotate functions, such as optimize.
This release was contributed by @rcybulski1122012 in https://github.com/strawberry-graphql/strawberry-django/pull/872
Add skip_queryset_filter parameter to filter_field() for declaring virtual (non-filtering) fields on filter types.
Add skip_queryset_filter parameter to filter_field() for declaring virtual (non-filtering) fields on filter types.
Fields marked with skip_queryset_filter=True appear in the GraphQL input type but are not applied as database filters. They are accessible via self.<field> in custom filter methods, making them useful for passing parameters like thresholds or configuration values.
@strawberry_django.filter_type(models.Fruit)
class FruitFilter:
min_similarity: float | None = strawberry_django.filter_field(
default=0.3, skip_queryset_filter=True
)
@strawberry_django.filter_field
def search(self, info: Info, queryset: QuerySet[models.Fruit], value: str, prefix: str):
if self.min_similarity is not None:
queryset = queryset.annotate(
similarity=TrigramSimilarity(f"{prefix}name", value)
).filter(similarity__gte=self.min_similarity)
return queryset, Q()
This release was contributed by @bellini666 in https://github.com/strawberry-graphql/strawberry-django/pull/876
Automatically inject FK fields into .only() on user-provided Prefetch querysets when the only optimization is enabled.
Automatically inject FK fields into .only() on user-provided Prefetch querysets
when the only optimization is enabled.
This prevents N+1 queries caused by Django re-fetching the FK field needed to match prefetched rows back to parent objects.
The optimizer now correctly resolves reverse relations by related_name and restricts
FK injection to ManyToOneRel, OneToOneRel, and GenericRelation.
This release was contributed by @bellini666 in https://github.com/strawberry-graphql/strawberry-django/pull/874
Fix N+1 queries when using optimize() inside a Prefetch object with .only() optimization. The optimizer now correctly auto-adds the FK field needed by
Fix N+1 queries when using optimize() inside a Prefetch object with .only() optimization. The optimizer now correctly auto-adds the FK field needed by Django to match prefetched objects back to their parent.
This release was contributed by @bellini666 in https://github.com/strawberry-graphql/strawberry-django/pull/873
Fix optimizer skipping optimization entirely for aliased fields. When a GraphQL query uses aliases for the same field (e.g., a: milestones { id } and
Fix optimizer skipping optimization entirely for aliased fields. When a GraphQL query uses aliases for the same field (e.g., a: milestones { id } and b: milestones { id }), the optimizer now merges them into a single prefetch instead of skipping optimization, preventing N+1 queries.
Aliases with different arguments (e.g., a: issues(filters: {search: "Foo"}) and b: issues(filters: {search: "Bar"})) are still skipped, since a single prefetch cannot satisfy both filter sets and optimizing one would produce wrong results for the other.
This release was contributed by @bellini666 in https://github.com/strawberry-graphql/strawberry-django/pull/871
Add native federation support via strawberry_django.federation module.
Add native federation support via strawberry_django.federation module.
New decorators that combine strawberry_django functionality with Apollo Federation:
strawberry_django.federation.type - Federation-aware Django type with auto-generated resolve_referencestrawberry_django.federation.interface - Federation-aware Django interfacestrawberry_django.federation.field - Federation-aware Django field with directives like @external, @requires, @providesExample usage:
import strawberry
import strawberry_django
from strawberry.federation import Schema
@strawberry_django.federation.type(models.Product, keys=["upc"])
class Product:
upc: strawberry.auto
name: strawberry.auto
price: strawberry.auto
# resolve_reference is automatically generated!
schema = Schema(query=Query)
The auto-generated resolve_reference methods support composite keys and multiple keys, and integrate with the query optimizer.
Note: This release requires strawberry-graphql>=0.303.0.
This release was contributed by @bellini666 in https://github.com/strawberry-graphql/strawberry-django/pull/858https://github.com/strawberry-graphql/strawberry-django/pull/870
Also, the deprecated asserts_errors parameter has been removed from test client query() methods. Use assert_no_errors instead.
Add support for strawberry-graphql 0.307.x.
Also, the deprecated asserts_errors parameter has been removed from test client query() methods. Use assert_no_errors instead.
This release was contributed by @bellini666 in https://github.com/strawberry-graphql/strawberry-django/pull/870
Fixes compatibility with strawberry-graphql>=0.296.0 by ensuring proper Info type resolution.
Fixes compatibility with strawberry-graphql>=0.296.0 by ensuring proper Info type resolution.
Info is now imported at runtime and resolver arguments include explicit type annotations.
This aligns with the updated behavior where parameter injection is strictly type-hint based rather than name-based.
Before, resolvers relying on implicit name-based injection could fail under newer Strawberry versions.
After this change, resolvers work correctly with the stricter type-based injection system introduced in newer releases.
This release was contributed by @daudln in https://github.com/strawberry-graphql/strawberry-django/pull/866
Additional contributors: @pre-commit-ci[bot]
Adding a deprecation warning when using FilterLookup[str] or FilterLookup[uuid.UUID]
Fix DuplicatedTypeName errors when using FilterLookup[str] by:
StrFilterLookup from the top-level strawberry_django moduleFilterLookup[str] or FilterLookup[uuid.UUID]Users should migrate from:
from strawberry_django import FilterLookup
@strawberry_django.filter_type(models.Fruit)
class FruitFilter:
name: FilterLookup[str] | None
To:
from strawberry_django import StrFilterLookup
@strawberry_django.filter_type(models.Fruit)
class FruitFilter:
name: StrFilterLookup | None
This release was contributed by @bellini666 in https://github.com/strawberry-graphql/strawberry-django/pull/851
Adds support for Django-style relationship traversal in strawberry_django.field(field_name=...) using LOOKUP_SEP (__). You can now flatten related obj
Adds support for Django-style relationship traversal in strawberry_django.field(field_name=...) using LOOKUP_SEP (__). You can now flatten related objects or scalar fields without custom resolvers.
Examples:
@strawberry_django.type(User)
class UserType:
role: RoleType | None = strawberry_django.field(
field_name="assigned_role__role",
)
role_name: str | None = strawberry_django.field(
field_name="assigned_role__role__name",
)
The traversal returns None if an intermediate relationship is None. Documentation and tests cover the new behavior, including optimizer query counts.
This release was contributed by @bellini666 in https://github.com/strawberry-graphql/strawberry-django/pull/852
Nothing published for this version
Fix offset pagination extensions so they receive pagination, order, and filter arguments consistently with connection fields. This allows extensions t
Fix offset pagination extensions so they receive pagination, order, and filter arguments consistently with connection fields. This allows extensions to inspect filters for permission/validation while keeping resolvers tolerant of missing params.
Pagination pageInfo.limit now returns the actual limit applied (after defaults and max caps), not the raw request value.
Pagination pageInfo.limit now returns the actual limit applied (after defaults and max caps), not the raw request value.
For example, with PAGINATION_DEFAULT_LIMIT=20, PAGINATION_MAX_LIMIT=50:
{ fruits(pagination: { limit: null }) { pageInfo { limit } } }
Before:
{
"data": {
"fruits": {
"pageInfo": {
"limit": null
}
}
}
}
After:
{
"data": {
"fruits": {
"pageInfo": {
"limit": 20
}
}
}
}
Also fixes limit: null to use PAGINATION_DEFAULT_LIMIT instead of PAGINATION_MAX_LIMIT.
This release was contributed by @bellini666 in https://github.com/strawberry-graphql/strawberry-django/pull/848
Add configurable PAGINATION_MAX_LIMIT setting to cap pagination requests, preventing clients from requesting unlimited data via limit: null or excessi
Add configurable PAGINATION_MAX_LIMIT setting to cap pagination requests, preventing clients from requesting unlimited data via limit: null or excessive limits.
This addresses security and performance concerns by allowing projects to enforce a maximum number of records that can be requested through pagination.
Configuration:
STRAWBERRY_DJANGO = {
"PAGINATION_MAX_LIMIT": 1000, # Cap all requests to 1000 records
}
When set, any client request with limit: null, negative limits, or limits exceeding the configured maximum will be capped to PAGINATION_MAX_LIMIT. Defaults to None (unlimited) for backward compatibility, though setting a limit is recommended for production environments.
Works with both offset-based and window-based pagination.
This release was contributed by @bellini666 in https://github.com/strawberry-graphql/strawberry-django/pull/847
This release fixes a bug, which caused nested prefetch_related hints to get incorrectly merged in certain cases.
This release fixes a bug, which caused nested prefetch_related hints to get incorrectly merged in certain cases.
This release was contributed by @diesieben07 in #839
Additional contributors: @patrick91
Nothing changed, testing the new release process using autopub.
Nothing changed, testing the new release process using autopub.
Nothing changed, testing the new release process using autopub.
Nothing changed, testing the new release process using autopub.
This release was contributed by @bellini666 in #837
Reviewers: @sourcery-ai[bot]
feat: use the new type-friendly way to define scalars from Strawberry by @bellini666 in https://github.com/strawberry-graphql/strawberry-django/pull/8
Full Changelog: https://github.com/strawberry-graphql/strawberry-django/compare/v0.71.0...v0.72.0
refactor: replace deprecated _enum_definition with __strawberry_definition__
Full Changelog: https://github.com/strawberry-graphql/strawberry-django/compare/v0.70.1...v0.71.0
fix(input): use None as default for Maybe fields instead of UNSET by @bellini666 in https://github.com/strawberry-graphql/strawberry-django/pull/824
Full Changelog: https://github.com/strawberry-graphql/strawberry-django/compare/v0.70.0...v0.70.1
feat: add support for strawberry.Maybe type in mutations and filter processing by @deepak-singh in https://github.com/strawberry-graphql/strawberry-dj
Full Changelog: https://github.com/strawberry-graphql/strawberry-django/compare/v0.69.0...v0.70.0
feat: use prefetch_related for FK with nested annotations
Full Changelog: https://github.com/strawberry-graphql/strawberry-django/compare/v0.68.0...v0.69.0
feat: declare support for django 6.0 by @bellini666 in https://github.com/strawberry-graphql/strawberry-django/pull/821
Full Changelog: https://github.com/strawberry-graphql/strawberry-django/compare/v0.67.2...v0.68.0
fix: fix wrong total_count when using distinct on m2m/o2m relationships
Full Changelog: https://github.com/strawberry-graphql/strawberry-django/compare/v0.67.1...v0.67.2
fix: fix n+1 regression with fragments and custom connections by @bellini666 in https://github.com/strawberry-graphql/strawberry-django/pull/809
Full Changelog: https://github.com/strawberry-graphql/strawberry-django/compare/v0.67.0...v0.67.1
Note: If you have a custom connection that defines a resolve_connection method, ensure that you have kwargs in case you are not defining all possible
Note: If you have a custom connection that defines a resolve_connection method, ensure that you have **kwargs in case you are not defining all possible keyword parameters.
Full Changelog: https://github.com/strawberry-graphql/strawberry-django/compare/v0.66.2...v0.67.0
fix: fix one extra broken future annotations with the new | syntax
Full Changelog: https://github.com/strawberry-graphql/strawberry-django/compare/v0.66.1...v0.66.2
fix: fix broken future annotations with the new | syntax by @bellini666 in https://github.com/strawberry-graphql/strawberry-django/pull/800
Full Changelog: https://github.com/strawberry-graphql/strawberry-django/compare/v0.66.0...v0.66.1
feat: support for Python 3.14 and drop 3.9, which has reached EOL by @bellini666 in https://github.com/strawberry-graphql/strawberry-django/pull/795
Full Changelog: https://github.com/strawberry-graphql/strawberry-django/compare/v0.65.1...v0.66.0
fix(field): prevent early ImportError on Field.type to break
Full Changelog: https://github.com/strawberry-graphql/strawberry-django/compare/v0.65.0...v0.65.1
Your coding agent can read these notes before it upgrades. Set up the MCP server →