* Add DjangoFormInputObjectType to forms/types
InputObjectType derived class which gets fields from django form.
Type of fields with choices (converted to enum) is set to custom scalar
type (using Meta.object_type) to dynamically convert enum values back.
* Correct Reporter model a_choice field type according to CHOICES tuple
* Add tests for DjangoFormInputObjectType
* Add pyenv files to .gitignore
* Fix pyupgrade
* Fix tests
* Add docs
* Fix docs example
---------
Co-authored-by: Firas Kafri <3097061+firaskafri@users.noreply.github.com>
* Remove redundant call to validate
The call to `validate` in the django view is redundant with the validation call in graphql-core.
* Remove whitespace
---------
Co-authored-by: Firas K <3097061+firaskafri@users.noreply.github.com>
* Use Python 3.10 for deployments on PyPi
* Update gh-action-pypi-publish version
* Update python version
* Update checkout and setup-python versions
* Upgrade dev dependencies
* fromat examples and few files to follow black new version
* Upgrade pytest version
---------
Co-authored-by: Firas Kafri <firaskafri@Firass-MacBook-Pro-2.local>
This test passes after reverting the `CustomField` resolver change
introduced in
https://github.com/graphql-python/graphene-django/pull/1315, but fails
with that resolver code present. For instance, adding back the resolver
code gives a test failure showing:
```
Failed: Expected to perform 2 queries but 11 were done
```
This should ensure there aren't regressions that prevent
query-optimization in the future.
* 🔧 Add pre-commit config
Similar to graphene and graphene-sqlalchemy
* ⬆ Bump black
* 👷 Lint on CI
* ⬆ Bump flake8-black
* 🔧 Keep excluding migrations
* ⬆ Bump flake8
* 🔧 Remove black and flake8 from tox config
* ⬆ Update pre-commit versions
* Upgrade syntax to python 3.7+
* Format with pre-commit
dedent docs/schema.py to allow formatting
* Fix tests on python 3.7
* Cast translated description for DecimalField
https://github.com/graphql-python/graphene-django/pull/976 casts all the description fields to strings to prevent schema printing from failing whenever the description is a lazy translated string. The `DecimalField` however got in after the v3 merge and it currently misses the cast.
* Fix row size
* 👽 Use .formatted instead of format_error
* ✅ Fix test with newer graphene
null default values (graphql-python/graphene@03277a5)
no more trailing newlines
Django's plain (non-model) forms don't have the `save` method, so
calling this would just result in an `AttributeError` before this
change.
Resolves#1152
* feat: add TypedFilter which allow to explicitly give a filter input GraphQL type
* Fix doc typo
Co-authored-by: Thomas Leonard <thomas@loftorbital.com>
* Add ability to pass `execution_context_class` to `GraphQLView.as_view()`
Currently when passing `execution_context_class` like this:
```
GraphQLView.as_view(execution_context_class=CustomContext)
```
you get the following error from `View.as_view()`
```
TypeError: GraphQLView() received an invalid keyword 'execution_context_class'. as_view only accepts arguments that are already attributes of the class.
```
this PR fixes the `hasattr` check in `.as_view`.
Fixes: #1072
* make black happy
removed whitespace
* Update Django's main branch name
* Add Python 3.9 to tox
* Update base gh action versions
* Add Django 3.2 to tests
* Remove redundant Django 1.11 references
* Update setup.py for new Django and Python versions