* treat warnings as errors when running the tests
* silence warnings
* bugfix: let DjangoConnectionField call its resolver function
that is, the one specified using DjangoConnectionField(..., resolver=some_func)
* ignore the DeprecationWarning about typing.ByteString in graphql
* Revert "feat!: check django model has a default ordering when used in a relay connection (#1495)"
This reverts commit 96c09ac439.
* Fix assert no warning for pytest>=8
* Allows field's choices to be a callable
Starting in Django 5 field's choices can also be a callable
* test if field with callable choices converts into enum
---------
Co-authored-by: Kien Dang <mail@kien.ai>
* Add support for validation rules
* Enable customizing validate max_errors through settings
* Add tests for validation rules
* Add examples for validation rules
* Allow setting validation_rules in class def
* Add tests for validation_rules inherited from parent class
* Make tests for validation rules stricter
If DjangoDebugMiddleware is installed, calling `cursor.execute(b)` where b is a `bytes` object causes the recording (and thus the entire database call) to throw a TypeError due to 775644b536/graphene_django/debug/sql/tracking.py (L126) :
```
"is_select": sql.lower().strip().startswith("select"),
```
Calling execute with a bytes parameter, to my knowledge, is not currently done within the high-level abstractions in the Django ORM, but is very much supported by psycopg2, as evidenced by the use in psycopg2's own `execute_values` in https://github.com/psycopg/psycopg2/blob/2_9_3/lib/extras.py#L1270 :
```
cur.execute(b''.join(parts))
```
This fix ensures that the sql parameter is safely decoded before scanning whether it begins with SELECT; since this is the only usage, the change is trivial.
The only workaround if code calls execute_values is to disable the DjangoDebugMiddleware altogether, which is far from ideal.
* adding optional_fields to enforce fields to be optional
* adding support for all
* adding unit tests
* Update graphene_django/rest_framework/mutation.py
Co-authored-by: Kien Dang <kiend@pm.me>
* linting
* linting
* add missing import
---------
Co-authored-by: Kien Dang <kiend@pm.me>
* Update Makefile
* django master requires at least python 3.10 now
* Allow customizing options passed to tox -e pre-commit
* py.test -> pytest
* Update ruff
* Fix E721
Do not compare types, use `isinstance()`
* Add back black to dev dependencies
* Pin black and ruff versions
* Use ruff in pre-commit
* Add pyupgrade
* Add isort
* Add bugbear
* Fix B015 Pointless comparison
* Fix B026
* B018 false positive
* Remove flake8 and isort config from setup.cfg
* Remove black and flake8 from dev dependencies
* Update black
* Show list of fixes applied with autofix on
* Fix typo
* Add C4 flake8-comprehensions
* Add ruff to dev dependencies
* Fix up
* Fix for issue #1385: Update mutation.py to serialize Enum objects into input values for ChoiceFields
* Update graphene_django/rest_framework/mutation.py
Co-authored-by: Steven DeMartini <1647130+sjdemartini@users.noreply.github.com>
---------
Co-authored-by: Steven DeMartini <1647130+sjdemartini@users.noreply.github.com>
* support reverse relationship for proxy models
* support multi table inheritence
* update query test for multi table inheritance
* remove debugger
* support local many to many in model inheritance
* format and lint
---------
Co-authored-by: Firas K <3097061+firaskafri@users.noreply.github.com>