Commit Graph

935 Commits

Author SHA1 Message Date
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
c501fdb20b swap back to python 3.11 2023-05-05 16:25:33 +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
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
bdb8e84446 Update cookbook for async testing 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
Josh Warwick
7ddaf9f5e6 Handle coroutine results from resolvers in connections and filter connections 2023-05-04 15:30:02 +01:00
Josh Warwick
28846f9ac9 drop in an async view 2023-05-04 15:30:02 +01:00
Josh Warwick
e78fb86ce6 handle regualr django lists 2023-05-04 15:30:02 +01:00
Josh Warwick
f04f0d33ff Support foriegn key connections running async 2023-05-04 15:30:00 +01:00
Josh Warwick
74998afb69 Support Django Connection resolving in an async context 2023-05-04 15:29:16 +01:00
Josh Warwick
6a5b28d09f Resolve DjangoObjectType getNode when in an async context 2023-05-04 15:29:16 +01:00
Ülgen Sarıkavak
8540a9332c
Add support for Python 3.11 (#1365)
* Add support for Python 3.11

* Fix Python 3.11 compatibility matrix

* Add temporary fix for default enum description

---------

Co-authored-by: Firas Kafri <firaskafri@Firass-MacBook-Pro-2.local>
2023-05-04 15:19:24 +03:00
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