* 🔧 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
* 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
* fixed broken links to graphene filter documentation (master->main)
* #1295 There is still a wrong link to github
The referenced example is in main branch
but the link goes to the master branch which still exists.
Co-authored-by: Peter Paul Kiefer <dafisppk@gmail.com>
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
* Added GraphQLTransactionTestCase
- Adds support for testing code that is executed within a transaction
Reference: https://docs.djangoproject.com/en/3.1/topics/testing/tools/#django.test.TransactionTestCase
```
For instance, you cannot test that a block of code is executing within a transaction, as is required when using select_for_update(). In those cases, you should use TransactionTestCase.
```
* Update testing.py
* Update testing.py
* Fixed formatting.
* Updated docs.
* Updated test.
* Update testing.rst