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.childchild.extra_data is now included in the parent's first SELECT.
This release was contributed by @bellini666 in #905
Drop support for Django 4.2.
- Django 4.2 will reach end of support on April 30, 2026. check here
Drop support for Django 5.0.
- Django 5.0 has reached end of support on April 2, 2025. See https://endoflife.date/django
Drop support for Django 5.1.
- Django 5.1 has reached end of support on December 2, 2025. See https://endoflife.date/django
This release was contributed by @p-r-a-v-i-n in #897
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 #894
Additional contributors: @bellini666
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 #892
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 #891
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.
This release was contributed by @bellini666 in #850
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 #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 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 #880
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 #872
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 #876
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 #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 Django to match prefetched objects back to their parent.
This release was contributed by @bellini666 in #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 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 #871
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-generatedresolve_referencestrawberry_django.federation.interface- Federation-aware Django interfacestrawberry_django.federation.field- Federation-aware Django field with directives like@external,@requires,@provides
Example 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.
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 #870
Additional contributors: @Copilot
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 #866
Additional contributors: @pre-commit-ci[bot]
Fix DuplicatedTypeName errors when using FilterLookup[str] by:
- Exporting
StrFilterLookupfrom the top-levelstrawberry_djangomodule - Adding a deprecation warning when using
FilterLookup[str]orFilterLookup[uuid.UUID] - Updating documentation to recommend using specific lookup types
Users should migrate from:
from strawberry_django import FilterLookup
@strawberry_django.filter_type(models.Fruit)
class FruitFilter:
name: FilterLookup[str] | NoneTo:
from strawberry_django import StrFilterLookup
@strawberry_django.filter_type(models.Fruit)
class FruitFilter:
name: StrFilterLookup | NoneThis release was contributed by @bellini666 in #851
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 #852
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.
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 #848
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 #847
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
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
- feat: use the new type-friendly way to define scalars from Strawberry by @bellini666 in #832
- feat: Add string-based lookups for UUID fields by @Akay7 in #829
- feat: make messages if there's assert_no_errors more verbose by @Akay7 in #828
- refactor: replace deprecated _enum_definition with strawberry_definition (https://github.com/strawberry-graphql/strawberry-django/commit/9acb4b25aa5cae25243ac48c4f1c7287db1216cc)
- fix(filters): use StrawberryField for DjangoModelFilterInput to respect python_name (https://github.com/strawberry-graphql/strawberry-django/commit/a3d9f14b8be14ebe1d2eebaa2daeb4680016e6e7)
- fix(input): use None as default for Maybe fields instead of UNSET by @bellini666 in #824
- feat: add support for strawberry.Maybe type in mutations and filter processing by @deepak-singh in #805
- feat: use prefetch_related for FK with nested annotations (https://github.com/strawberry-graphql/strawberry-django/commit/a6b3f85f80064093137602d3bd79c8a525fbe9ca)
- feat: declare support for django 6.0 by @bellini666 in #821
- docs: add comprehensive guides for production usage by @bellini666 in #810
- chore(examples): modernize examples with modular apps and current best practices by @bellini666 in #811
- docs: fix critical code example errors and typos by @bellini666 in #819
- fix: fix wrong total_count when using distinct on m2m/o2m relationships (ff1f016fbd95ddaa7cd76cd712a58ad460ca87df)
- fix: fix n+1 regression with fragments and custom connections by @bellini666 in #809
- fix: docs by @wimble3 in #802
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.
- fix: fix one extra broken future annotations with the new | syntax (https://github.com/strawberry-graphql/strawberry-django/commit/cb9df84f64755074e37ddbad5f11ef1e0eadfd23)
- fix: fix broken future annotations with the new | syntax by @bellini666 in #800
- feat: support for Python 3.14 and drop 3.9, which has reached EOL by @bellini666 in #795
- fix: fix debug toolbar integration to work with v6.0 by @bellini666 in #796
- fix: Fix typo in depecation message for order decorator by @zvyn in #785
- fix(field): prevent early ImportError on Field.type to break (https://github.com/strawberry-graphql/strawberry-django/commit/a353b4f376fce9fb3b4faf88a1f92bcad857ea49)
- feat: bump minimum Strawberry version to 0.276.2
- fix: ensure dataclass's kwarg-only is specified to allow mixing fields (closes #768) by @axieum in #769
- fix: handle lazy filters and ordering in strawberry_django.connection by @rcybulski1122012 in #773
- docs: Fix minor typo "recommented". by @roelzkie15 in #775
- test: pytest-xdist for parallel testing by @roelzkie15 in #776
- delete unused filters for creating mutations by @star2000 in #761
- fix: fix filters using lazy annotations by @bellini666 in #765
- Add support for AND/OR filters to be lists by @soby in #762
- feat(security): disallow mutations without filters by @star2000 in #755
- fix(ordering): fix lazy types in ordering by @bellini666 in #759
- fix(optimizer): Pass accurate "info" parameter to PrefetchCallable and AnnotateCallable by @diesieben07 in #742
- feat: wrap resolvers in
django_resolver(...)to ensure appropriate async/sync context by @axieum in #746
- fix: Fix "ordering" for connections and offset_paginated by @diesieben07 in #741
This release brings some very interesting features, thanks to @diesieben07 🍓
- A new ordering type is now available, created using
@strawberry_django.order_type. This type uses a list for specifying ordering criteria instead of an object, making it easier and more flexible to apply multiple orderings, ensuring they will keep their order. Check the ordering docs for more info on how to use it - Support for "true" cursor-based pagination in connections, using the new
DjangoCursorConnectiontype. Check the relay docs for more info on how to use it
Also, to maintain consistency across the codebase, we have renamed several classes and functions. The old names are still available for import and use, making this a non-breaking change, but they are marked as deprecated and will eventually be removed in the future. The renames are as follows:
ListConnectionWithTotalCountgot renamed toDjangoListConnectionstrawberry_django.filtergot renamed tostrawberry_django.filter_type
- feat: Add new ordering method allowing ordering by multiple fields by @diesieben07 in #679
- feat: Add support for "true" cursor based pagination in connections by @diesieben07 in #730
- refactor: rename ListConnectionWithTotalCount and filter for consistency by @bellini666 in #739
- fix: Fix duplicate LOOKUP_SEP being used when field hints are used with polymorphic queries by @diesieben07 in #736
- fix: Fix a minor typing issue by @diesieben07 in #738
- docs: Fix resolvers.md by @Hermotimos in #735
- feat: Official Django 5.2 support by @bellini666 in #728
- feat: Improve handling of polymorphism in the optimizer by @diesieben07 in #720
- fix: Compatibility with Django Debug Toolbar 5.1+ by @cpontvieux-systra in #725
- fix: Ensure max_results is consistently applied for connections by @Mapiarz in #727
- chore: Update mutations.py to expose the full_clean parameter by @keithhackbarth in #701
- Improve fallback primary key ordering unit tests by @SupImDos in #716
- Fix unnecessary window pagination being used by @diesieben07 in #719
- Add support for the the general
Geometrytype by @shmoon-kr in #709
- Move
django-tree-queriesdependency to dev (it was wrongly added to main dependencies) (https://github.com/strawberry-graphql/strawberry-django/commit/fec457e589646dc4790f80c67286da714871a81c)
- docs: fix inverted link tags by @pbratkowski in #692
- docs: fix typo by @ticosax in #696
- fix: omit TestClient from pytest's test discovery by @pbratkowski in #694
- fix(optimizer): Avoid merging prefetches when using aliases by @bellini666 in #698
- feat: Allow setting max_results for connection fields by @bellini666 in #689
- feat: Bump strawberry minumum version to 0.257.0, which contains a fix for https://github.com/strawberry-graphql/strawberry/security/advisories/GHSA-5xh2-23cc-5jc6 by @bellini666 in #688
- fix(mutations): Make sure we skip refetch when the optimizer is disabled (https://github.com/strawberry-graphql/strawberry-django/commit/06f62c74a37fc20d3122e7528add8e6c6119e591)
- fix: skip empty choice value when generating enums from choices by @fabien-michel in #687
- test: Replace django mptt with django tree queries for tests by @kwongtn in #684
- fix(optimizer): Fix nested pagination optimization for m2m relations by @bellini666 in #681
- Update test scope to include django 5.1 by @kwongtn in #683
- Support multi-level nested create/update with model
full_clean()by @philipstarkey in #659
- fix(optimizer): Prevent issuing duplicated queries for certain uses of first() and get() by @diesieben07 in #675
- fix(pagination)!: Use
PAGINATION_DEFAULT_LIMITwhen limit is not provided by @bellini666 in #673 - fix(mutations): Refetch instances to optimize the return value by @bellini666 in #674
- Fix Django permissions diagram syntax by @sersorrel in #663
- allow FullCleanOptions in full_clean arg annotation by @g-as in #667
- Forward metadata when processing django type by @g-as in #666
- Added missing unpacking of strawberry.LazyType to optimzer.py by @NT-Timm in #670
- Improved language in mutations docs by @KyeRussell in #668
- Batch Mutations for creating, updating, and deleting #438 by @keithhackbarth in #653
- docs: fix import typo by @lozhkinandrei in #661
- docs: Fix incorrect import paths in faq.md by @videvide in #669
- feat: New Paginated generic to be used as a wrapped for paginated results by @bellini666 in #642 (learn how to use it in the docs page)
- Update filtering caution in mutations.md by @ldynia in #648
- update model_property path in the doc by @alainburindi in #654
- docs: Remove mention about having to enable subscriptions in the docs by @bellini666 in #645
- Add unit tests for partial input optional field behaviour in update mutations by @SupImDos in #638
- fix: Make sure that async fields always return Awaitables by @bellini666 in #646
- feat: Official support for Python 3.13 and drop support for Python 3.8 which has reached EOL by @bellini666 in #643
- Changed the recommended library for JWT Authentication in Django to strawberry-django-auth by @pkrakesh in #633
- Change default Relay input m2m types from
ListInput[NodeInputPartial]toListInput[NodeInput]by @SupImDos in #630 - refactor: Remove guardian ObjectPermissionChecker monkey patch by @bellini666 in #631
- Fix calculation of
has_next_pageinresolve_connection_from_cacheby @SupImDos in #622 - Update docs for main website by @patrick91 in #605
- docs: Update docs URLs to point to the new location by @bellini666 in #606
- docs: General doc improvements by @bellini666 in #610
- fix: Fix debug toolbar upgrade issue by @bellini666 in #600
- fix: Only set False to clear FileFields when updating an instance by @bellini666 in #601
- feat: Bump strawberry to 0.236.0 and refactor changed imports by @bellini666 in #591
- refactor(optimizer): Split optimizer code to make it cleaner and easier to understand/maintain by @bellini666 in #575
- fix(optimizer): Convert select_related into Prefetch when the type defines a custom get_queryset by @bellini666 in #583
- fix(optimizer): Avoid extra queries for prefetches with existing prefetch hints by @bellini666 in #582
- fix: Do not try to call an ordering object's
ordermethod if it is not a decorated method by @bellini666 in #584 - fix: Avoid pagination failures when filtering connection by last without before/after by @bellini666 in #585
- fix: Fix and test optimizer with polymorphic relay node by @stygmate in #570
- fix: Fix nested pagination/filtering/ordering not working when "only optimization" is disabled by @aprams in #569
- feat: Add support for auto mapping of ArrayFields by @bellini666 in #567
- fix: Set files early on mutations to allow clean methods to validate them by @bellini666 in #566
- fix: Make sure the optimizer calls the type's
get_querysetfor nested lists/connections by @bellini666 in #568
- docs: wrong typo on filter on fruitfilter by @OdysseyJ in #555
- docs: Remove officially unmaintained project by @Eraldo in #557
- test: Add some tests to ensure Interfaces can be properly optimized by @bellini666 in #554
- fix: Extract interface definition in optimizer to fix django-polymorphic by @ManiacMaxo in #556
- fix: fix optimized nested connections failing to access totalCount by @bellini666 and @Eraldo in #553
- feat: Nested optimization for lists and connections by @bellini666 in #540
This releases finally enables the highly anticipated nested optimization for lists and connections 🚀
What does that mean? Remember that when trying to retrieve a relation list inside another type and also trying to filter/order/paginate, that would cause n+1 issues because it would force the prefetched list to be thrown away? Well, not anymore after this release! 😊
In case you find any issues with this, please let us know by registering an issue with as much information as possible on how to reproduce the issue.
Note that even though this is enabled by default, nested optimizations can be disabled by passing enabled_nested_relations_prefetch=False when initializing the optimizer extensions.
- Dropped support for Django versions earlier than 4.2
The nested optimization feature required features only available on Django 4.2+.
To be able to implement it, and also considering that django itself recommended dropping support for those versions, from now on this lib requires Django 4.2+
- Added
export-schemacommand to Docs by @Ckk3 in #546 - fix: Fix specialized connection aliases missing filters/ordering by @bellini666 in #547
NOTE: Even though this only contains a bug fix, I decided to do a minor release because the fix is bumping the minimum required version of strawberry-graphql itself to 0.234.2.
- refactor: Use graphql-core's collect_sub_fields instead of our own implementation by @bellini666 in #537
- fix: Move Info out of the TYPE_CHECKING block to prevent a warning (https://github.com/strawberry-graphql/strawberry-django/commit/4e8c458b1a6c546af705e797d80edf48ca74d693)
- docs: Fix typo by @Eraldo in #531
- feat: Add setting DEFAULT_PK_FIELD_NAME by @noamsto in #446
- fix: Fix AttributeError when using optimizer and prefetch_related by @jacobwegner in #533
- feat: Avoid calling Type.get_queryset method more than once by @bellini666 in (https://github.com/strawberry-graphql/strawberry-django/commit/690551374053760903d70c6d267e73a64c6ad282)
- test(listconnectionwithtotalcount): check the number of SQL queries when only fetching totalCount by @euriostigue in #525
- fix(optimizer): handle existing select_related in querysets by @taobojlen in #515
- fix: Delete mutation should not throw error if no objects in filterset by @keithhackbarth in #522
- fix: fix annotations inheritance override for python 3.8/3.9
- feat: support for strawberry 0.227.1+
- feat: Ability to use custom field_cls for connections and nodes (#517)
- Fix typos in filtering documentation by @cdroege in #520
- Fixing Docs Typo by @drewbeno1 in #513
- fix: fix debug toolbar when used with apollo_sandbox ide (#514)
- fix: fix debug toolbar running on ASGI and Python 3.12
- feat: properly resolve
_idfields toID(#506)
This release contains a major refactor of how filters and ordering works with this library (#478).
Thank you very much for this excellent work @Kitefiko 😊
Some distinctions between the new API and the old API:
- The previously deprecated
NOTfilters with a leadingnwere removing,NOTis the only negation option from now on - New
DISTINCT: Booleanoption to call.distinct()in the resulting QuerySet: https://strawberry-graphql.github.io/strawberry-django/guide/filters/#and-or-not-distinct - Custom filters can be defined using a method with the
@strawberry_django.filter_fielddecorator: https://strawberry-graphql.github.io/strawberry-django/guide/filters/#custom-filter-methods - The default filter method can be overriden also by using a
@strawberry_django.filter_fielddecorator: https://strawberry-graphql.github.io/strawberry-django/guide/filters/#overriding-the-default-filter-method - Lookups have been separated into multiple types to make sure the API is not exposing an invalid lookup for a given attribute (e.g. trying to filter a
BooleanFieldby__range): https://strawberry-graphql.github.io/strawberry-django/guide/filters/#generic-lookup-reference
IMPORTANT NOTE: If you find any issues and/or can't migrate your codebase yet, the old behaviour can still be achieved by setting USE_DEPRECATED_FILTERS=True in your django settings: https://strawberry-graphql.github.io/strawberry-django/guide/filters/#legacy-filtering
Also, make sure to report any issues you find with the new API.
- It is now possible to define custom ordering methods: https://strawberry-graphql.github.io/strawberry-django/guide/ordering/#custom-order-methods
- The
Orderingenum have 4 more options:ASC_NULLS_FIRST,ASC_NULLS_LAST,DESC_NULLS_FIRSTandDESC_NULLS_LAST: https://strawberry-graphql.github.io/strawberry-django/guide/ordering/#ordering - The default order method can now be overridden for the entire resolution: https://strawberry-graphql.github.io/strawberry-django/guide/ordering/#overriding-the-default-order-method
There are no breaking changes in the new ordering API, but please report any issues you find when using it.
- Fix
_perm_cacheprocessing by @vecchp in #498 - feat: Add support for generated enums in mutation input by @cngai in #497
- chore: update and improve github workflows by @bellini666 in #492
- fix: use str() to trigger eventual django's gettext_lazy string by @fabien-michel in #493
- Fix auto enum value allowed chars by @fabien-michel in #494
- Add py.typed marker for mypy by @pm-incyan in #486
- fix: OneToManyInput saves and runs validation on foreign key #487 by @keithhackbarth in #490
- Expose pagination api publicly by @fireteam99 in #476
- Fix permissioned pagination by @vecchp in #480
- feat: allow extensions to prevent results from being fetched by @bellini666 in #481
- chore: Rename all links to the new repository name by @bellini666 in #477
- fix: cache definitions in optimizer by @yergom in #474
- validate files at dummy-instance level by @sdobbelaere in #469
- fix: fix files not being saved on create mutation by @bellini666 in #464
- feat(optimizer): Do not defer select_related fields if no only was specified by @bellini666 in #465
- fix: Return
nullon empty files/images by @bellini666 in #466
- Documentation improvements by @thclark in #456
- fix(docs): Add missing import to resolver snippet by @lewisjared in #457
- Allow updates of nested fields by @tokr-bit in #449
- fix(docs): Standardising the use of strawberry_django throughout the documentation. by @ArcD7 in #440
- Fix code example on updating
field_type_map. by @alimony in #441 - fix: support for fields using async only extensions by @bellini666 in #444
- fix: HasPerm on async fields, fix missing query in another test by @devkral in #437
- fix(docs): resolvers.md strawberry_django import by @hkfi in #436
- Official support for Django 5.0
- Fix: ordering when dealing with camelCased field by @he0119 in #430
- Guarantee 'AND', 'OR', and 'NOT' filter fields get evaluated last by … by @TWeidi in #424
- Login and CurrentUser queries yield broken responses by @sdobbelaere in #421
- fix small errata by @jalvarezz13 in #419
- Refactor create method to ensure proxy-model compatibility by @sdobbelaere in #394
- Fix typing issues by @patrick91 in #418
- [pre-commit.ci] pre-commit autoupdate by @pre-commit-ci in #416
- perf: cache nested import of get_user_or_annonymous to improve performance by @bellini666 in #417
- fix: make sure custom fields are kept during inheritance by @bellini666 in #415
- fix: Use _RESOLVER_TYPE as the type for the resolver on field, so the… by @guizesilva in #412
- feat: Enforce validation for updating nested relations by @tokr-bit in #405
- feat: support for strawberry 0.212.0+ by @bellini666 in #410
- docs: Fix typos in optimization examples by @sjdemartini in #406
- docs: Fix typos in object-level Permissions documentation by @sjdemartini in #407
- fix: keep ordering sequence by @bellini666 in #409
- Fixed Documentation issue #390: added explanation of the error and PYTHON_CONFIGURE_OPTS: a little bit verbose, but maybe will save someone time and possibly add contributors to the project by @thepapermen in #392
- docs: Added strawberry-django-extras to community-projects.md by @m4riok in #395
- [pre-commit.ci] pre-commit autoupdate by @pre-commit-ci in #400
- chore: migrate from black to ruff-formatter by @bellini666 in #403
- compatibility ASGI/websockets get_request, login and logout by @sdobbelaere in #393
- chore: Update docs to include changes to partial behavior by @whardeman in #385
- Docs improvement Subscriptions by @sdobbelaere in #376
- New Feature: Optional custom key_attr to that can be used instead of id (pk) in to access model in Django UD mutations (Issue #348) by @thepapermen in #387
- fix: fix a regression when checking permissions for an async resolver
- fix: ensure permissions' resolve_for_user get safely resolved inside async contexts
- FIX: DEBUG_TOOLBAR_CONFIG consideration by @bpeterman in #384
- feat: support for python 3.12 by @bellini666 in #359
- feat: deprecate nSomething in favor of using NOT by @bellini666 in #381
- Fix: DjangoOptimizerExtension corrupts nested objects' fields' prefetch objects by @aprams in #380
- Exclude id from model fields to avoid overriding the id: type by @sdobbelaere in #373
- [pre-commit.ci] pre-commit autoupdate by @pre-commit-ci in #365
- Update relay.md to working example by @sdobbelaere in #368
- Expose disable_optimization argument on by @Mapiarz in #370
- Support inList and nInList lookup in filters on enum by @cpontvieux-systra in #363
- feat: Add ValidationError code to OperationMessage by @zvyn in #358
- Docs on Mutations: Fixed issue with relay.NodeInput not existing, imported NodeInput from strawberry_django instead by @thepapermen in #353
- [pre-commit.ci] pre-commit autoupdate by @pre-commit-ci in #355
- docs: fix sample code on 'Serving the API' by @miyashiiii in #357
- [pre-commit.ci] pre-commit autoupdate by @pre-commit-ci in #332
- Fix typo in optimizer docs for
strawberry.django.typeannotation by @fireteam99 in #334 - Adds tip regarding automatic single query filter generation to docs by @fireteam99 in #341
- [pre-commit.ci] pre-commit autoupdate by @pre-commit-ci in #342
- [pre-commit.ci] pre-commit autoupdate by @pre-commit-ci in #350
- refactor: strawberry.union is deprecated, use
Annotatedinstead by @bellini666 in #347 - Unwrap django lazy objects in mutation resolvers by @ryanprobus in #338
- feat: support strawberry 0.199.0+ by @bellini666 in #326
- feat: drop python 3.7 support, which EOLed on June 2023, following strawberry's 0.198.0 release
- refactor: make sure to not insert duplicate permission directives to the field
- refactor: make sure to also call the type's get_queryset when retrieving nodes for connection or a list of nodes
- Update mutations.md by @baseplate-admin in #319
- [pre-commit.ci] pre-commit autoupdate by @pre-commit-ci in #321
- filters support 'NOT' 'AND' 'OR' by @star2000 in #313
- feat: make sure to run the type's
get_querysetwhen one is defined on resolve_model_node (#316)
- Fix TypeError with IntegerChoices and Add Tests for Enum Conversion without django_choices_field by @miyashiiii in #314
- docs: change one occurence of select_related to prefetch_related by @Wartijn in #306
- fix: fix an issue where non dataclass annotations where being injected as fields on input types by @bellini666 in #310
- Add new keywords "fields" and "exclude" to type decorator for auto-population of Django model fields by @coleshaw in #293
- fix: fix resolving optional fields based on reverse one-to-one relations by @bellini666 in #309
- fix: default pagination/filters/order to UNSET for fields (#257)
- refactor!: use a setting to decide if we should map fields to relay types or not by @bellini666 in #302
NOTE: If you are using relay integration in all your types, you probably will want to set MAP_AUTO_ID_AS_GLOBAL_ID=True in your strawberry django settings to make sure auto gets mapped properly to GlobalID on types and filters.
- feat: add command export schema by @menegasse in #299
- feat: expose
interfaceon strawberry_django/init.py by @bellini666 in #300
- [pre-commit.ci] pre-commit autoupdate by @pre-commit-ci in #291
- fix: pass **kwargs to the type's
get_querysetwhen defined by @bellini666 in #295 - Fix missing model docstring crash by @Mapiarz in #297
- docs: update absolute path to relative in markdown file by @miyashiiii in #296
- Fixed typo dic by @selvarajrajkanna in #290
- Handle Django GENERATE_ENUMS_FROM_CHOICES with strawberry.auto by @pcraciunoiu in #286
- docs: tweak links to work with non-root path for hosting by @DavidLemayian in #283
- Typo fix in documentation by @paltman in #285
- Remove usage of
concrete_ofby @patrick91 in #287
- fix: make sure field_name overriding is not ignored when querying data (#282)
- fix: the type's queryset doesn't receive **kwarg
- fix: make sure the type's get_queryset gets called for resolved coroutines (#281)
- chore: expose missing input_mutation in init file
- docs: fix some documentation examples
- fix: reset annotation cache to fix some inheritance issues when using
strawberry>=0.192.2by @bellini666 in #278
- fix: do not import anything from
strawberry.djangothat is not in this lib by @bellini666 in #277
This release is a major milestone for strawberry-django. Here are some of its highlights:
- The strawberry-django-plus lib was finally merged into this lib, meaning all the extra features it provides are available directly in here. strawberry-django-plus is being deprecated and the development of its features is going to continue here. Here is a quick summary of all the features ported from it:
- The query optimizer extension
- The relay integration (based on the new official relay support from strawberry)
- Enum integration with django-choices-field and auto generation from fields with choices
- Lots of improvements to mutations, allowing CUD mutations to handle nested creation/updating/etc
- The permissioned resolvers, designed as field extensions now instead of the custom schema directives it used
- All the API has been properly typed, meaning that type checkers should be able to properly validate calls to
strawberry_django.type(...)/strawberry_django.field(...)/etc - The docs have been updated with all the new features
- A major performance improvement: Due to all the refactoring and improvements, some personal benchmarks show a performance improvement of around 10x when comparing the
v0.9.5and 8x when comparing tostrawberry-django-plus
- refactor!: overall revamp of the type/field code and typing improvements by @bellini666 in #265
- feat: relay integration by @bellini666 in #267
- feat: ModelProperty descriptor by @bellini666 in #268
- feat: query optimizer extension by @bellini666 in #271
- feat: enum integration by @bellini666 in #270
- feat: improved mutations by @bellini666 in #272
- feat: permissions extensions using the django's permissioning system by @bellini666 in #273
- docs: document all new features from this lib and improve existing ones by @bellini666 in #274
- add .DS_Store to gitignore by @capital-G in #248
- Add kwargs to the documentation about get_queryset by @cdroege in #250
- Update test matrix to include django 4.2 by @kwongtn in #253
- chore: migrate from flake8/isort to ruff by @bellini666 in #237
- [pre-commit.ci] pre-commit autoupdate by @pre-commit-ci in #259
- add strawberry.relay tests, fix compatibility with relay, fix other issues by @devkral in #260
- refactor: replace Extension by SchemaExtension as required by strawberry 0.160.0+
- fix: do not add filters to non list fields (thanks @g-as for reporting this regression)
- Update test django version from 4.2a1 to 4.2b1 by @kwongtn in #241
- feature: backporting django-debug-toolbar from strawberry-django-plus by @frleb in #239
- refactor: do not insert
pkarguments inside non root fields by @bellini666 in #246
- chore: do not limit django/strawberry upper bound versions
- Add django 4.0,4.2 to tests & updated minor versions by @kwongtn in #228
- Fix private field handling by @devkral in #231
- fix(typo): Fix typo in table of contents by @rennerocha in #216
- removed
django-filterfrom pyproject.toml, added tests matrix by @nrbnlulu in #219 - Add actionlint for GitHub Actions files by @kwongtn in #221
- Fix django version matrix. by @nrbnlulu in #222
- Geos fields query & mutation support by @kwongtn in #213
- Started docs for query by @ccsv in #147
- fix: Fix resolver annotation resolution by @bellini666 in #212
- [pre-commit.ci] pre-commit autoupdate by @pre-commit-ci in #203
- Change how we set the default annotation by @patrick91 in #206
- fix: Prevent memory leaks when checking if the search method accepts an info keyword
- [pre-commit.ci] pre-commit autoupdate by @pre-commit-ci in #198
- Updates documentation for
get_querysetby @fireteam99 in #199 - Update pagination.md by @fabien-michel in #202
- [pre-commit.ci] pre-commit autoupdate by @pre-commit-ci in #201 0.7 - 2022-10-16
- [pre-commit.ci] pre-commit autoupdate by @pre-commit-ci in #192
- Implementing filter, order and pagination in
StrawberryDjangoFieldsuper classes by @ManiacMaxo in #193 - Allow passing info in filters by @kwongtn in #191
- import TypedDict from typing_extensions for Python 3.7 by @whardeman in #189
- Fix demo app by @moritz89 in #190
- fix: get_queryset sends self in fields.py which it shouldnt by @deshk04 in #188
- [pre-commit.ci] pre-commit autoupdate by @pre-commit-ci in #178
- Fix mutations and filtering for when using strawberry-graphql >=0.132.1 by @jkimbo in #183
- Broaden is_strawberry_django_field to support custom field classes by @benhowes in #185
- fix: Only append order to the resolver if it is a list 0.5 - 2022-09-10
- Update docs link in README by @q0w in #154
- Documentation for overriding the field class by @benhowes in #158
- fix: Raise NotImplementedError on unknown Django fields by @noelleleigh in #161
- Add many type hints by @noelleleigh in #162
- adding installation with pip by @sisocobacho in #166
- feat: Use Django textual metadata in GraphQL by @noelleleigh in #160
- Update pagination.md by @tanaydin in #170
- Fix field ordering inheritance by @DanielHuisman in #176
- fix(doc): update mkdocs.yml to point to correct branch by @DavidLemayian in #175 0.4 - 2022-07-09
- Update docs language and formatting by @augustebaum in #124
- feature: allow overriding field class by @benhowes in #135
- Site for docs by @nrbnlulu in #140
- feat: link JSONField to strawberry.scalars.JSON by @FlickerSoul in #144
- [pre-commit.ci] pre-commit autoupdate by @pre-commit-ci in #141
- docs: document how to use a custom filter logic by @devkral in #116
- fixed various typos by @g-as in #118
- Change order of inheritance for
StrawberryDjangoFieldby @hiporox in #122 - [pre-commit.ci] pre-commit autoupdate by @pre-commit-ci in #123
- feat: allow Enums to work with FilterLookup by @hiporox in #126
- [pre-commit.ci] pre-commit autoupdate by @pre-commit-ci in #127
- fix: pass through more field attributes by @benhowes in #129
- fix: resolve
ManyToManyRelandManyToOneRelas non-null lists by @FlickerSoul in #131 0.3 - 2022-05-23
- Feature: Register mutation by @NeoLight1010 in #45
- Fix filtering in
get_querysetof types with enabled pagination by @illia-v in #60 - Add permissions to django mutations by @wellzenon in #53
- Fix a bug related to creating users with unhashed passwords by @illia-v in #62
- pre-commit config file and fixes by @la4de in #68
- Clean deprecated API by @la4de in #69
- updated the way event loop is detected in 'is_async' by @g-as in #72
- Fix detecting
autoannotations when postponed evaluation is used by @illia-v in #73 - Updated docs by @ccsv in #78
- Fix incompatibility with Strawberry >= 0.92.0 related to interfaces by @illia-v in #76
- Fixed issue with generating order args by @jaydensmith in #90
- Update .gitignore to the python standard by @hiporox in #97
- feat: add Enum support to filtering by @hiporox in #100
- build: update packages by @hiporox in #94
- Caching Extensions using Django Cache by @hiporox in #93
- docs: filled in some missing info in the docs by @hiporox in #98
- Fix ordering with custom filters by @hiporox in #108
- bugfix: ignore filters argument if it is an arbitary argument by @devkral in #115
- Fixing Quick Start by @akkim2 in #114
- Fix #110 - Add **kwargs passthrough on CUD mutations, enables "description" annotation from Strawberry. by @JoeWHoward in #111
- Use auto from strawberry instead of define our own by @bellini666 in #101
- Fix filtering cannot use relational reflection fields by @star2000 in #109
- refactor: Change the use of "is_unset" to "is UNSET" by @bellini666 in #117