* 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>
* change Sphinx version from 1.5.3 to 7.0.0
* change sphinx-autobuild version from 0.7.1 to 2021.3.14
* add pygments-graphql-lexer to docs/requirements.txt
* 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>
pre-commit is currently configured nicely but hasn't been part of the
Makefile setup and isn't mentioned in the contributing notes. This
change makes it so that pre-commit is installed as a part of the dev
setup, whereas before it had to be manually installed.
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.
Currently the relay cookbook's readme has a link to the plain tutorial
page. The plain cookbook readme also instructs the user to change
directory into the directory for the relay example. This change fixes
both issues.
Also changed the title for the relay example to specify that it uses
relay.
* 🔧 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
Introduces two changes to make sure the instructions in the tutorial don't require debugging:
- Add `cd ..` when first syncing the database so that `manage.py` is accessible in the working directory.
- Change `cookbook.ingredients.apps.IngredientsConfig.name` to `cookbook.ingredients` from `ingredients` to prevent the following exception:
```python
django.core.exceptions.ImproperlyConfigured: Cannot import 'ingredients'. Check that 'cookbook.ingredients.apps.IngredientsConfig.name' is correct.
```
* Fix code examples in queries.rst
Code example in Arguments section doesn't work as stated in its comment — if "foo" or "bar" are not declare in the graphql query, it will be an error, not they become None.
Code example in Info section has invalid indentation, `resolve_questions()` seems to be a `Query` method, but it's indented as module-level function.
* Fix indentation in query examples
* Enable syntax highlight for graphql queries