strawberry-graphql / strawberry-django

Strawberry GraphQL Django extension
https://strawberry.rocks/docs/django
MIT License
421 stars 123 forks source link

Introduce ObjectDoesNotExist as OperationMessage.kind enum value #649

Open tokr-bit opened 1 month ago

tokr-bit commented 1 month ago

I propose to introduce a new OperationMessage.kind value: ObjectDoesNotExist.

Feature Request Type

Description

If an object does not exist, Django raises an ObjectDoesNotExist-exception. This is translated into an OperationMessage with the kind field being set to OperationMessage.Kind.ERROR: https://github.com/strawberry-graphql/strawberry-django/blob/5f5aca95b4ef98d770ddc6c5c7aaa21b16607085/strawberry_django/mutations/fields.py#L53

However, as an API user, this value might be misleading. Therefore, I propose to introduce a new enum-Value, e.g. ObjectDoesNotExist.

Upvote & Fund

Fund with Polar