Commit Graph

165 Commits

Author SHA1 Message Date
Pablo Alexis Domínguez Grau
3f813d4679
Fix ReadTheDocs builds (#1509)
* Add RTD config file

* Doc fixes to reference main branch instead of master
2024-03-29 12:11:56 +08:00
Noxx
c416a2b0f5
Provide setting to enable/disable converting choices to enums globally (#1477)
Co-authored-by: Firas Kafri <3097061+firaskafri@users.noreply.github.com>
Co-authored-by: Kien Dang <mail@kien.ai>
2023-12-20 17:55:15 +08:00
Kien Dang
feb7252b8a
Add support for validation rules (#1475)
* 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
2023-12-20 12:48:45 +03:00
Romain Létendart
ee7560f629
Support displaying deprecated input fields in GraphiQL docs (#1458)
* Update GraphiQL docs URL in docs/settings

And deduplicate link declaration.

* Support displaying deprecated input fields in GraphiQL docs
2023-09-13 09:49:01 +03:00
lilac-supernova-2
67def2e074
Typo fixes (#1459)
* Fix Star Wars spaceship name

* Fix some typos in comments

* Typo fixes

* More typo fixes
2023-09-06 10:29:58 +03:00
Laurent
0de35ca3b0
fix: fk resolver permissions leak (#1411)
* fix: fk resolver permissions leak

* fix: only one query for 1o1 relation

* tests: added queries count check

* fix: docstring

* fix: typo

* docs: added warning to authorization

* feat: added bypass_get_queryset decorator
2023-07-18 15:16:52 +03:00
Jeongseok Kang
3f061a0c50
docs: Update location of GraphQL Relay Specification (#1432) 2023-07-18 15:10:22 +03:00
ndpu
be17278b49
Add DjangoFormInputObjectType to forms/types (#1325)
* 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>
2023-05-24 15:58:50 +03:00
ndpu
a6596273cf
Update docs/requirements.txt (#1410)
* 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
2023-05-24 15:55:20 +03:00
Firas K
df3c0bf75b Update filtering.rst 2023-04-26 22:46:40 +03:00
Firas K
7e1a1d1fb8 Update django-filter url 2023-04-26 22:46:40 +03:00
Nikolai Røed Kristiansen
4517e32224
👷 Add pre-commit (#1336)
* 🔧 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
2022-10-19 17:10:30 +03:00
Syberen van Munster
bb03306075
Move testing endpoint to settings (#1105)
* Import testing endpoint from graphene settings

* Add documentation for TESTING_ENDPOINT setting

* Remove empty lines

* Run formatter

Co-authored-by: Firas K <3097061+firaskafri@users.noreply.github.com>
2022-09-26 01:56:22 +03:00
Suyeol Jeon
a78114ada3
Add support to persist GraphQL headers in GraphiQL (#1209) 2022-09-24 17:41:14 +03:00
Gabriel Lacroix
9a60589732
Make instructions runnable without tweaking (#1224)
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.
```
2022-09-24 16:02:33 +03:00
belkka
97442f9cee
Fix code examples in queries.rst (#1265)
* 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
2022-09-24 16:00:22 +03:00
Yiğit Y. Er
4f315c365d
minor fix on schema.py part (#1306)
The documentation already suggests importing ObjectType from graphene, graphene.ObjectType is not necessary while defining the Query class.
2022-09-22 19:10:52 +01:00
Aaron Forsander
f6ec0689c1
Fix documentation references: op_name -> operation_name (#1312) 2022-03-03 16:58:48 +03:00
Peter Paul Kiefer
0bb9f1ca60
I found another wrong link in the filter dokumentation see #1309 (#1311)
* 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>
2022-02-13 08:50:53 +03:00
Peter Paul Kiefer
bf8fd7696b
fixed broken links to graphene filter documentation (master->main) (#1309)
Co-authored-by: Peter Paul Kiefer <dafisppk@gmail.com>
2022-02-12 17:31:45 +03:00
Tim Schilling
5d5d7f1815
Django v4, python 3.10 support for graphene-django v3 (#1281)
Co-authored-by: Yair Silbermintz <MisterGlass@users.noreply.github.com>
2022-01-07 20:26:07 +00:00
Chouaib Lammas
ef9d67302e
Fix ingredient model (#1258)
Add the required positional argument: 'on_delete'
2021-12-10 12:51:10 +03:00
Thomas Leonard
80ea51fc3b
Add typed filters (v3) (#1148)
* feat: add TypedFilter which allow to explicitly give a filter input GraphQL type

* Fix doc typo

Co-authored-by: Thomas Leonard <thomas@loftorbital.com>
2021-03-31 10:31:45 -07:00
Ülgen Sarıkavak
3058118e8f
Tox & actions updates (#1143)
* 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
2021-03-24 09:32:37 +03:00
Jason Kraus
e9f25ecf2d
enhancement: DjangoDebugContext captures exceptions and allows captured stack traces to be queried (#1122) 2021-03-02 10:45:46 -08:00
Tonye Jack
5cee41407c
Added GraphQLTransactionTestCase (#1099)
* 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
2021-02-22 20:24:02 -08:00
Thomas Leonard
2d4ca0ac7b
Add enum support to filters and fix filter typing (v3) (#1119)
* - 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>
2021-02-22 20:21:32 -08:00
Jason Kraus
c3404a9793
document purpose of DjangoConnectionField (#1107) 2021-02-02 09:58:43 -08:00
Jason Kraus
d9ab8acf26
document auth pattern: return None with resolve method (#1106)
* document auth pattern: return None with resolve method

* (doc, auth): also show that one can raise an exception in a resolve method
2021-02-02 09:58:21 -08:00
Jason Kraus
c049ab7470
WIP: Merge master into v3 (#1086)
* 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
2020-12-30 15:37:57 -08:00
Jonathan Kim
33c6a54414 Merge branch 'master' into v3 2020-08-12 07:06:35 +01:00
Radosław Kowalski
55769e814f
Add headers support to GraphiQL (#1016)
Co-authored-by: Jonathan Kim <jkimbo@gmail.com>
2020-08-07 10:13:26 +01:00
Jonathan Kim
6cfcddac5a Merge branch 'master' into v3 2020-08-06 20:35:08 +01:00
Nikolai Røed Kristiansen
2308965658
Extract query function from GraphQLTestCase making it possible to use in a pytest fixture (#1015) 2020-08-05 20:24:16 +01:00
Jonathan Kim
97de26bf2e
Update tutorial docs (#994) 2020-08-05 20:17:53 +01:00
Eric Abruzzese
6aa6aaaa8c
Update GraphiQL, add GraphiQL subscription support (#1001) 2020-07-12 14:42:31 +01:00
Radosław Kowalski
1f752b6cad
Warn if fields or exclude are not defined on DjangoObjectType (#981) 2020-06-11 11:09:52 +01:00
DoctorJohn
17146f9b01
Make v3 django choice field enum naming default (in v3) (#982)
Co-authored-by: Jonathan Kim <jkimbo@gmail.com>
2020-06-10 17:32:07 +01:00
Jonathan Kim
fb90cb78b3 Merge branch 'master' into v3 2020-05-22 11:17:36 +01:00
Chris Hart
b1f6d41209
fixes minor typo in docs index (#969) 2020-05-22 11:12:27 +01:00
vineethvanga18
a987035ef3
fix typo (#959) 2020-05-11 21:03:17 +01:00
Jonathan Kim
9b41472922 Merge branch 'master' into v3 2020-05-09 12:50:39 +01:00
Jonathan Kim
b4e34a5794
Improve DjangoListField (#929) 2020-05-09 12:28:03 +01:00
Jonathan Kim
8990e173ac
Add extra types documentation (#902) 2020-05-09 12:19:02 +01:00
Jean-Louis Fuchs
10d22de98e
graphql 3.0 and graphene 3.0 final rebase (#951) 2020-05-09 12:13:47 +01:00
kimbriancanavan
82d8dbc893
Convert MultipleChoiceField to List of type String (#611) 2020-04-25 14:22:09 +01:00
Jonathan Kim
657208054a Merge branch 'master' into v3 2020-04-16 14:29:38 +01:00
Roy Segall
3483428f70
Adding documentation for installing django-filter (#928) 2020-04-12 12:57:11 +01:00
Ülgen Sarıkavak
dd0d6ef28f
Python 3 (#904)
* 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.
2020-04-06 13:21:07 +01:00
fneitzel
b84f61afab
Documentation missing endpoint explanation (#918)
* 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>
2020-04-06 09:58:55 +01:00