graphql-python / graphene-django

Build powerful, efficient, and flexible GraphQL APIs with seamless Django integration.
http://docs.graphene-python.org/projects/django/en/latest/
MIT License
4.28k stars 766 forks source link

Make use of http.HTTPStatus for response status code checks #1487

Closed ulgens closed 5 months ago

ulgens commented 8 months ago

I got this idea from https://www.b-list.org/weblog/2023/dec/04/python-http-status-codes/ . I always liked DRF's status and I think it makes the code easier to read. Python's http version of the same thing is not looking nice as DRF's in my opinion (.HTTP_200_OK vs .OK), but still an improvement over using directly the numeric codes.

kiendang commented 8 months ago

And if you want to use it in the main codebase we can alias Python's http statuses?