Commit Graph

581 Commits

Author SHA1 Message Date
Firas Kafri
2ae927f06a
Merge branch 'main' into support-async 2023-08-10 09:33:42 +03:00
Firas Kafri
4ac3f3f42d
Update __init__.py 2023-08-10 01:12:15 +03:00
Firas Kafri
ee7598e71a
Remove typo 2023-08-09 23:41:57 +03:00
Firas Kafri
05d7fb5396
Bump version 2023-08-09 20:49:51 +03:00
Kien Dang
79b4a23ae0
Miscellaneous CI fixes (#1447)
* Update Makefile

* django master requires at least python 3.10 now

* Allow customizing options passed to tox -e pre-commit

* py.test -> pytest

* Update ruff

* Fix E721

Do not compare types, use `isinstance()`

* Add back black to dev dependencies

* Pin black and ruff versions
2023-08-09 20:48:42 +03:00
Laurent
db34d2e815
fix: foreign key nullable and custom resolver (#1446)
* fix: nullable one to one relation

* fix: makefile
2023-08-09 20:28:26 +03:00
Kien Dang
9a773b9d7b
Use ruff in pre-commit (#1441)
* Use ruff in pre-commit

* Add pyupgrade

* Add isort

* Add bugbear

* Fix B015 Pointless comparison

* Fix B026

* B018 false positive

* Remove flake8 and isort config from setup.cfg

* Remove black and flake8 from dev dependencies

* Update black

* Show list of fixes applied with autofix on

* Fix typo

* Add C4 flake8-comprehensions

* Add ruff to dev dependencies

* Fix up
2023-08-06 01:47:00 +03:00
James
5d7a04fce9
Update mutation.py to serialize Enum objects into input values (#1431)
* Fix for issue #1385: Update mutation.py to serialize Enum objects into input values for ChoiceFields

* Update graphene_django/rest_framework/mutation.py

Co-authored-by: Steven DeMartini <1647130+sjdemartini@users.noreply.github.com>

---------

Co-authored-by: Steven DeMartini <1647130+sjdemartini@users.noreply.github.com>
2023-07-27 02:41:40 +03:00
Firas Kafri
3172710d12
exclude 'fans' from ReporterForm tests (#1434) 2023-07-18 20:35:51 +03:00
Tom Dror
b1abebdb97
Support base class relations and reverse for proxy models (#1380)
* support reverse relationship for proxy models

* support multi table inheritence

* update query test for multi table inheritance

* remove debugger

* support local many to many in model inheritance

* format and lint

---------

Co-authored-by: Firas K <3097061+firaskafri@users.noreply.github.com>
2023-07-18 20:17:45 +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
Firas Kafri
2fafa881a8
Bump version 2023-07-18 15:13:58 +03:00
Steven DeMartini
cd43022283
Maintain JSONField in graphene_django.compat module (#1429)
Fixes https://github.com/graphql-python/graphene-django/issues/1428

This should improve backwards compatibility, fixing issues in downstream
packages (notably graphene-django-cud
https://github.com/tOgg1/graphene-django-cud/issues/109, and also
graphene-django-extras, both of which depended on
`graphene_django.compat.JSONField`).

Co-authored-by: Steven DeMartini <sjdemartini@users.noreply.github.com>
2023-07-18 15:11:30 +03:00
Firas Kafri
e950164c8e
Bump version to 3.1.2 2023-06-17 09:29:18 +03:00
Steven DeMartini
2358bd30a4
Update compat.py MissingType results after PGJSONField removal (#1423)
As mentioned in https://github.com/graphql-python/graphene-django/pull/1421/files#r1221711648
2023-06-07 20:06:37 +03:00
Dulmandakh
8fa8aea3c0
remove JSONField compat (#1421)
* remove JSONFIeld compat

* fix black
2023-06-07 17:36:29 +03:00
Sezgin ACER
8934393909
Add check for serializers.HiddenField on fields_for_serializer function (#1419)
* Add check for `serializers.HiddenField` on fields_for_serializer function

* Add pre-commit changes
2023-06-06 09:20:32 +03:00
Steven DeMartini
520ddeabf6
Fix graphiql explorer styles by including official CSS, and update local example app for testing (#1418)
* Add venv and .venv to gitignore since common venv paths

* Update cookbook-plain app requirements and local-dev notes

This also adds the DEFAULT_AUTO_FIELD to the app's Django settings to
resolve this warning when running `migrate`:

```
ingredients.Category: (models.W042) Auto-created primary key used when not defining a primary key type, by default 'django.db.models.AutoField'.
	HINT: Configure the DEFAULT_AUTO_FIELD setting or the IngredientsConfig.default_auto_field attribute to point to a subclass of AutoField, e.g. 'django.db.models.BigAutoField'.
```

* Fix #1417 graphiql explorer styles by including official CSS

Like in the official graphiql-plugin-explorer example here
6198646919/packages/graphiql-plugin-explorer/examples/index.html (L26-L29)

Resolves https://github.com/graphql-python/graphene-django/issues/1417

* Update GraphiQL version

---------

Co-authored-by: Steven DeMartini <sjdemartini@users.noreply.github.com>
Co-authored-by: Kien Dang <mail@kien.ai>
2023-06-02 11:48:53 +03:00
Kien Dang
38709d8396
Correct schema write test (#1416)
<Mock>.called_once() just returns a Mock, so assert <Mock>.called_once()
always passes. We want <Mock>.assert_called_once().
2023-05-27 16:53:22 +03:00
Paul Craciunoiu
5a19111182 Fix graphiql for async 2023-05-26 23:01:33 +08:00
Firas Kafri
ebf49431e9
Bump version 2023-05-24 16:10:22 +03:00
Firas Kafri
7fe661d423
Bump version 2023-05-24 16:03:14 +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
Mykhailo Havelia
388ca41d64
fix: use execution_context_class attribute for GraphQLView (#1398)
* fix: use execution_context_class attribute for GraphQLView
2023-05-24 15:54:44 +03:00
Josh Warwick
37ebd6309b follow main removing validate call 2023-05-16 20:26:05 +01:00
Josh Warwick
c16276c731
Merge branch 'main' into support-async 2023-05-16 20:20:11 +01:00
Josh Warwick
2659d67fd0 updates tests 2023-05-16 20:19:35 +01:00
Josh Warwick
848536ee3a Clean up wrapped list resolver 2023-05-16 19:46:07 +01:00
Josh Warwick
84ba7d775a Remove unused path 2023-05-16 17:46:23 +01:00
Josh Warwick
fba274dc4d refactor middleware 2023-05-16 17:09:15 +01:00
Josh Warwick
c27dd6c732 cleanup middleware 2023-05-16 17:03:24 +01:00
Josh Warwick
930248f78d Refactor out async helper functions 2023-05-16 16:20:13 +01:00
Josh Warwick
d3f8fcf906 handle connections without middleware 2023-05-16 16:08:40 +01:00
Josh Warwick
8c068fbc2b Update to pull out mutations and ensure that DjangoFields don't get double sync'd 2023-05-10 19:17:30 +01:00
Josh Warwick
b134ab0a3e Handle custom Djangoconnectionresolvers 2023-05-09 23:27:02 +01:00
Josh Warwick
b69476f50f improve async detection 2023-05-09 22:58:15 +01:00
Josh Warwick
791209f557 Rejig concept to use middleware 2023-05-09 21:52:55 +01:00
Josh Warwick
58b92e6ed3 linting 2023-05-05 16:28:40 +01:00
Josh Warwick
76eeea4e78 Update tests for queries 2023-05-05 16:19:13 +01:00
Josh Warwick
e9d5e88ea2 Handle the default django list field and test the async execution of the fields 2023-05-05 11:18:21 +01:00
shukryzablah
09f9b6d2f1
Remove redundant call to validate (#1393)
* 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>
2023-05-05 13:04:22 +03:00
Kien Dang
52f992183f
Add GraphiQL Explorer plugin (#1397) 2023-05-04 22:06:10 +03:00
Josh Warwick
c10753d4b1 most recent changes 2023-05-04 15:51:25 +01:00
Josh Warwick
4e5862f8fb Add logging of errors in execution 2023-05-04 15:30:43 +01:00
Josh Warwick
4d5132d925 Remove tests for now 2023-05-04 15:30:43 +01:00
Josh Warwick
64d311d770 Copy tests for query to test async execution 2023-05-04 15:30:42 +01:00
Josh Warwick
0a84a6ea38 Handle async get_node 2023-05-04 15:30:23 +01:00
Josh Warwick
1b2d5e02e4 handle async serlizer mutations 2023-05-04 15:30:02 +01:00
Josh Warwick
66938e9e29 async hates csrf 2023-05-04 15:30:02 +01:00
Josh Warwick
ebbc578435 Strange scope 2023-05-04 15:30:02 +01:00