* 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
* 🔧 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
* 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>
* feat: add TypedFilter which allow to explicitly give a filter input GraphQL type
* Fix doc typo
Co-authored-by: Thomas Leonard <thomas@loftorbital.com>
* 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
* - Add filtering support for choice fields converted to graphql Enum (or not)
- Fix type of various filters (used to default to String)
- Fix bug with contains introduced in previous PR
- Fix bug with declared filters being overridden (see PR #1108)
- Fix support for ArrayField and add documentation
* Fix for v3
Co-authored-by: Thomas Leonard <thomas@loftorbital.com>
* merge master into v3
* fix order_by snake casing by checking if value is None, switch executor to execution_context_class since schema.execute no longer supports executor
* fix linting by removing duplicate defintion and test of convert_form_field_to_string_list
* Remove Python 2 support
* Upgrade Python & Django versions
* Remove unsupported Django versions
* Remove unsupported Python versions
* Add Python 3.8
* Drop support for django-filter < 2
* Update LoginRequiredMixin doc link
* Remove redundant import
* Resolve RemovedInDjango40Warning warnings
* gql/graphene-django/graphene_django/tests/test_converter.py:175:
RemovedInDjango40Warning: django.utils.translation.ugettext_lazy() is
deprecated in favor of django.utils.translation.gettext_lazy().
* graphene-django/graphene_django/utils/utils.py:28:
RemovedInDjango40Warning: force_text() is deprecated in favor of
force_str().
* No need to use unicode strings with Python3
* Remove singledispatch dependency
singledispatch is inluded with Python >= 3.4, no need for external
package.
* Documentation missing endpoint explanation
Add some information about GRAPHQL_URL. Otherwise people run into ERROR 400 problems, if they have a different endpoint.
* Update docs/testing.rst
Co-Authored-By: Jonathan Kim <jkimbo@gmail.com>
Co-authored-by: Jonathan Kim <jkimbo@gmail.com>
* Add new setting to create unique enum names
* Add specific tests for name generation
* Add schema test
* Rename settings field
* Rename setting
* Add custom function setting
* Add documentation
* Use format instead of f strings
* Update graphene_django/converter.py
Co-Authored-By: Syrus Akbary <me@syrusakbary.com>
* Fix tests
* Update docs
* Import function through import_string function
Co-authored-by: Syrus Akbary <me@syrusakbary.com>
* replace merge_queryset with resolve_queryset pattern
* skip double limit test
* Update graphene_django/fields.py
Co-Authored-By: Jonathan Kim <jkimbo@gmail.com>
* yank skipped test
* fix bad variable ref
* add test for annotations
* add test for using queryset with django filters
* document ththat one should use defer instead of values with queysets and DjangoObjectTypes