strawberry-graphql/strawberry-django

`mutations.delete` and `mutations.update` do not support both `filters` _and_ `handle_django_errors`

Offen

#544 geöffnet am 04.06.2024

 (2 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)Python (152 Forks)auto 404
enhancementhelp wanted

Repository-Metriken

Stars
 (496 Sterne)
PR-Merge-Metriken
 (PR-Metriken ausstehend)

Beschreibung

Describe the Bug

When handle_django_errors is turned on (either globally or for an individual mutation) for mutations.delete and mutations.update then filters on those mutations has no effect.

System Information

  • Operating system: Ubuntu
  • Strawberry version: 0.234.0
  • Strawberry Django version: 0.42.0

Additional Context

The problem is here: https://github.com/strawberry-graphql/strawberry-django/blob/90e1878959d83af471fc20d8f4c611ce2e767fa8/strawberry_django/filters.py#L320-L321

When handle_django_errors is turned on, is_list is no longer true, because the return type is now a union with OperationInfo. Additionally, the return type is now no longer even a list.

Contributor Guide