Commit Graph

904 Commits

Author SHA1 Message Date
Firas K
af8888f58e
Upgrade github actions versions, default python and dev dependencies (#1407)
* 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>
2023-05-03 13:25:16 +03:00
Steven DeMartini
c1a22bfd91 Add pre-commit to dev-setup
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.
2023-05-03 12:08:22 +03:00
Kien Dang
95a0642818 fix: fix graphiql request failure 2023-05-03 12:07:54 +03:00
Firas K
a8ceca77ed Bump version 2023-05-03 11:54:46 +03:00
Steven DeMartini
20a6cecc4c Add test validating query performance with select_related + prefetch_related
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.
2023-05-03 11:37:17 +03:00
Steven DeMartini
9796e93fc7 Remove obsolete tests and add note about rationale 2023-05-03 11:37:17 +03:00
Steven DeMartini
f67c5dbc8c Revert field resolver logic to fix poor query performance
This reverts the change to `convert_field_to_djangomodel` introduced in
https://github.com/graphql-python/graphene-django/pull/1315 for the
reasons discussed here
https://github.com/graphql-python/graphene-django/pull/1315/files#r1015659857.
As mentioned there, without reverting this code, "queries are forced
every time an object is resolved, making an exponential number of
queries when nesting without any possibility of optimizing".

That regression prevented `graphene-django-optimizer` from working with
`graphene-django` v3.0.0b9+ (where this change first was published), as
discussed in
https://github.com/graphql-python/graphene-django/issues/1356#issuecomment-1284718187,
https://github.com/tfoxy/graphene-django-optimizer/issues/86, and
https://github.com/tfoxy/graphene-django-optimizer/pull/83#issuecomment-1451987397.

For now, this marks the two tests that depended on this problematic code
as "expected to fail", and perhaps they can be reintroduced if there's a
way to support this logic in a way that does not prevent
`select_related` and `prefetch_related` query-optimization and introduce
nested N+1s.

As mentioned here
https://github.com/graphql-python/graphene-django/pull/1315#issuecomment-1468594361,
this is blocking upgrade to graphene-django v3 for many users, and
fixing this would allow many to begin upgrading and contributing to keep
graphene-django going.
2023-05-03 11:37:17 +03:00
Firas K
34cc86063b
☂️ v3.0.1 ☂️ 2023-04-29 20:26:39 +03:00
Firas K
a335042dbe
☂️ v3.0.1 ☂️ 2023-04-29 20:26:05 +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
Kien Dang
3283d0b1be Update GraphiQL to 2.4.1 2023-04-17 09:17:21 +03:00
Bendik Eger
1d814c54c4 Fix schema print with -.graphql 2023-04-10 14:52:10 +03:00
Josh Warwick
0beb3385df import error resolved? 2023-03-01 11:13:00 +03:00
Josh Warwick
3b41aaf7bf Remove promise based middleware 2023-03-01 11:13:00 +03:00
Kien Dang
d18cab8aa4 Update graphiql to 1.4.7 2022-12-25 01:09:13 +03:00
Ülgen Sarıkavak
daa0ab046b
Update pre-commit tools (#1364) 2022-11-23 01:16:14 +03:00
Omar Mirza
a000d58514 Clarify cookbook example READMEs
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.
2022-11-15 09:56:28 +03:00
Yuekui
86c5309c45
Fix broken UT due to pytest import error (#1368) 2022-11-14 13:56:18 +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
Syrus Akbary
f24cbd5148
Fix custom foreignkey resolvers (#1361)
* Fix custom foreignkey resolvers

* Fixed assert name conversion

* Fix lint
2022-10-17 16:57:24 +02:00
Firas K
ed7c995d8c
☂️ v3.0.0 ☂️ (#1355) 2022-09-26 15:08:32 +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
Firas K
c697e5c8c1
Bump version to v3.0.0b9 (#1353) 2022-09-26 01:27:22 +03:00
Suyeol Jeon
a78114ada3
Add support to persist GraphQL headers in GraphiQL (#1209) 2022-09-24 17:41:14 +03:00
Alan Rivas
07940aa5f5
Update tutorial-relay.rst (#1220) 2022-09-24 16:03:45 +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
Forest Anderson
0b2cc4ecb2
Fixed deprecation warning (#1313) 2022-09-24 16:00:45 +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
belkka
60b3032014
Fix type hint for DjangoObjectTypeOptions.model (#1269)
Proper type is `typing.Type[Model]`, not `Model`
2022-09-24 16:00:12 +03:00
Craig
05d3df92e7
Delay assignment of csrftoken (#1289) 2022-09-24 15:59:53 +03:00
Firas K
541caa117e
Fixes related to pr#1412 (#1352)
* fix: setup.py graphene dependency

* fix: graphene_django/tests/test_get_queryset.py format

Co-authored-by: Firas Kafri <firaskafri@Firass-MacBook-Pro-2.local>
2022-09-24 15:50:40 +03:00
Semyon Pupkov
0f40da7b31
Make errors in form mutation non nullable (#1286) 2022-09-23 11:47:10 +03:00
Thomas Leonard
5d81ba04f9
fix: unit test for graphene pr#1412 (#1315)
* Issue #1111: foreign key should also call get_queryset method

* fix: test for graphene PR https://github.com/graphql-python/graphene/pull/1412

Co-authored-by: Thomas Leonard <thomas@loftorbital.com>
2022-09-23 11:45:02 +03:00
Firas K
b2f83eb277
Bump version to 3.0.0b8 (#1348) 2022-09-23 11:38:11 +03:00
andrei-datcu
56892d7f4b
Cast translated description for DecimalField (#1255)
* 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
2022-09-22 19:13:30 +01: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
Thomas Leonard
a53ded611b
feat: update name of DjangoFilterConnectionField type input to be consistent with graphene (Issue #1316) (#1317)
Co-authored-by: Thomas Leonard <thomas@loftorbital.com>
2022-09-22 19:09:29 +01:00
Thomas Leonard
37848fa2df
fix: convert Django BigIntegerField to BigInt GraphQL type (#1318)
Co-authored-by: Thomas Leonard <thomas@loftorbital.com>
2022-09-22 19:09:11 +01:00
Thomas Leonard
3473fe025e
fix: backward pagination (#1346)
Co-authored-by: Thomas Leonard <thomas@loftorbital.com>
Co-authored-by: Laurent  <laurent.riviere.pro@gmail.com>
2022-09-22 16:01:28 +01:00
Thomas Leonard
42a40b4df0
chore: update dev dependencies (#1345)
Co-authored-by: Thomas Leonard <thomas@loftorbital.com>
2022-09-22 10:26:21 +01:00
Nikolai Røed Kristiansen
8ae576394e
💥 Stop supporting EOL djangos and pythons (#1337)
* 💥 Stop supporting EOL djangos and pythons

* 👷 Run only supported version in test workflow
2022-09-19 14:31:04 +02:00
Thomas Leonard
2aeb86ba3b
fix: backward pagination indexing error when using bigger last argument than total number of elements (#1344)
Co-authored-by: Thomas Leonard <thomas@loftorbital.com>
2022-09-06 14:00:13 +02:00
Nikolai Røed Kristiansen
5f1731dca3
Fix: Use .formatted instead of format_error (#1327) & Fix tests
* 👽 Use .formatted instead of format_error

*  Fix test with newer graphene

null default values (graphql-python/graphene@03277a5)
no more trailing newlines
2022-08-15 11:41:39 +02: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
Keith
775644b536
Update requirements to the official graphene 3.0 release (#1290) 2022-01-22 20:04:30 +00:00
Jarkko Piiroinen
e1a7d19833
Convert DecimalField to Decimal instead of Float in DRF and form converters (#1277)
* Convert serializer DecimalField to Decimal

* Convert form DecimalField to Decimal
2022-01-18 17:03:08 +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