You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: RELEASE.md
+4-30Lines changed: 4 additions & 30 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,34 +4,8 @@ release type: minor
4
4
5
5
Adjust the optimizer to handle when the same field is selected multiple times via aliases with different arguments and the field doesn't have a custom resolver.
6
6
7
-
Also add support for aliasing custom fields with `annotate`/`prefetch_related` optimizer hint callables, together with three new public helpers:
7
+
Also add support for aliasing custom fields with `annotate`/`prefetch_related` optimizer hint callables, together with three new public helpers (see the [optimizer guide](https://strawberry-graphql.github.io/strawberry-django/guide/optimizer/) for examples):
8
8
9
-
-`optimizer_hint_key(info)`: returns a unique, deterministic attribute name for the current field selection (based on the response key, i.e. the alias). It returns the same value inside an optimizer hint callable and inside the field's resolver, so it can be used to name a `Prefetch(to_attr=...)` in the hint and read the value back in the resolver.
10
-
-`get_hint_value(source, info, default_attr=None, *, default=...)`: reads the value produced by an optimizer hint for the current selection, checking the alias-scoped attribute/label first and falling back to `default_attr`/`default`. Dict-form annotations with multiple callable labels are supported, so a resolver can combine several per-alias annotated values.
11
-
-`get_field_arguments(info)`: resolves the argument values of the current field selection (including variables), usable both inside hint callables and resolvers.
Each alias resolves the hint callable with its own scoped `info`, and callable annotations are stored under an alias-scoped label so they don't clash with each other.
9
+
-`optimizer_hint_key(info)`: a unique, deterministic attribute name for the current field selection (based on the alias), stable between the hint callable and the resolver.
10
+
-`get_hint_value(source, info, default_attr=None, *, default=...)`: reads the value produced by an optimizer hint for the current selection.
11
+
-`get_field_arguments(info)`: resolves the argument values of the current field selection (including variables), usable in both hint callables and resolvers.
0 commit comments