Commit Graph

62 Commits

Author SHA1 Message Date
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
Lucas
fdeadf5ce5
Fix project setup (#1087)
* Fix project setup

* Fix test_should_query_postgres_fields
2021-01-02 09:46:00 -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
da9f41c295 Rename get_resolver -> wrap_resolve and fix tests 2020-08-06 20:45:30 +01:00
Jonathan Kim
6cfcddac5a Merge branch 'master' into v3 2020-08-06 20:35:08 +01:00
Thiago Bellini Ribeiro
d50955a173
Do not break when after is greater than list_length (#999) 2020-07-09 18:01:22 +01:00
Jonathan Kim
965ebdee13 Merge branch 'master' into v3 2020-06-27 11:14:09 +01:00
Jonathan Kim
3026181b28
Set first amount to max limit if not set (#993) 2020-06-25 15:10:56 +01:00
Paul Craciunoiu
3c229b619e
Fix hasNextPage - revert to count. Fix after (#986)
Co-authored-by: Jonathan Kim <jkimbo@gmail.com>
2020-06-25 13:00:24 +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
Paul Craciunoiu
c00203499b
DjangoConnectionField slice: use max_limit first, if set (#965) 2020-06-06 19:00:21 +01:00
Jonathan Kim
fb90cb78b3 Merge branch 'master' into v3 2020-05-22 11:17:36 +01:00
Paul Craciunoiu
2225ed62e1
Do not access the internals of SimpleLazyObject (#945) 2020-05-09 17:35:09 +01:00
Jean-Louis Fuchs
10d22de98e
graphql 3.0 and graphene 3.0 final rebase (#951) 2020-05-09 12:13:47 +01:00
Jean-Louis Fuchs
b9f0e4f9ae
Make tests order independent (#932)
* Reset the global registry after each test (teardown)

* Create a settings fixtures that returns graphene_settings and resets
  the graphene_settings after use (teardown)

* Convert test_mutation tests from unittests.TestCase to pytest

* Convert test_mutation PetType to a pet_type fixtures that reregisters
  the type
2020-04-20 13:23:20 +01:00
Jason Kraus
a818ec9017 replace merge_queryset with resolve_queryset pattern (#796)
* 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
2019-11-28 10:49:37 +00:00
Jonathan Kim
b7e4937775
Alias only_fields as fields and exclude_fields as exclude (#691)
* Create new fields and exclude options that are aliased to exclude_fields and only_fields

* Update docs

* Add some checking around fields and exclude definitions

* Add all fields option

* Update docs to include `__all__` option

* Actual order of fields is not stable

* Update docs/queries.rst

Co-Authored-By: Semyon Pupkov <semen.pupkov@gmail.com>

* Fix example code

* Format code

* Start raising PendingDeprecationWarnings for using only_fields and exclude_fields

* Update tests
2019-07-09 14:03:11 +01:00
Jonathan Kim
40ae7e53ec
Fix manager check in DjangoConnectionField (#693)
* Fix default manager check

* Add test
2019-07-02 19:37:50 +01:00
Jonathan Kim
775d2e3523
Update travis and tox (#667)
* Update travis and tox

* Use xenial distribution

* Don't install coveralls twice

* Add black and flake8 tox commands

* Remove Python 3.5 test for Django master

* Fix indent

* Ignore migrations

* Remove black for now

* Run black formatting (#668)

* Run black format

* Update makefile

* Add black to travis build
2019-06-10 20:54:30 -07:00
Mel van Londen
b271b259bd
Merge pull request #603 from abettke/fix/enhanced-proxy-model-support
Adds enhanced support for proxy models.
2019-06-09 16:47:10 -07:00
mvanlonden
94602c77c6 add reverse relation one to one query test 2019-06-09 12:41:04 -07:00
Andrew Bettke
a7ee042e9d Merge branch 'master' of https://github.com/graphql-python/graphene-django into fix/enhanced-proxy-model-support 2019-04-01 22:15:16 +13:00
Jason Kraus
0a5020bee1 Get queryset (#528)
* first attempt at adding get_queryset

* add queryset_resolver to DjangoConnectionField and fix test failures

* cleanup get_queryset API to match proposal as close as possible

* pep8 fix: W293

* document get_queryset usage

* add test for when get_queryset is defined on DjangoObjectType
2019-03-31 12:01:17 +01:00
Andrew Bettke
959e98eeb0 Refactor to use formal to_global_id. 2019-03-28 09:56:10 +13:00
Andrew Bettke
a461e80ee4 Correctly encode / decode for python3+. 2019-03-27 17:56:06 +13:00
Andrew Bettke
83a2ad34cd Encode strings before passing to b64encode. 2019-03-27 17:28:56 +13:00
Andrew Bettke
36ac5626e9 Adds enhanced support for proxy models. 2019-03-27 17:09:25 +13:00
Syrus Akbary
54ef52e1c6 Reformatted files using black 2018-07-19 16:52:24 -07:00
Daniel Bachler
c32340662c Remove print statement 2018-03-28 12:28:58 +02:00
Daniel Bachler
4d41160379 Update resolve method signature to 2.0 style in new test 2018-02-28 17:45:25 +01:00
Daniel Bachler
e05fbcc1b3 Fix failing unit test by handling cases where a connection is resolved involving a query with inner join and distinct that is then filtered and would be combined with a filtered queryset that is not distinct. 2018-02-28 14:41:47 +01:00
Daniel Bachler
23eb8eea80 Add failing test case 2018-02-28 14:41:47 +01:00
Syrus Akbary
c0edb0c927
Merge pull request #373 from jm2242/proxy-model-support
Basic Proxy model support
2018-02-11 13:46:13 -08:00
Syrus Akbary
adde400893
Merge pull request #335 from urbandove/master
models.DateField => graphene Date Scalar
2018-02-08 12:14:13 -08:00
Jonathan Mares
0b103417f9 on_delete param where needed due to django 2 requirements
added support for querying a model with objects that may be a proxy model, fixed and added tests

a few style changes
2018-02-03 11:10:04 -05:00
=
51f794edb6 Test Connectionfield with custom Manager 2017-12-12 12:52:32 -05:00
=
616c549d2c Fix ConnectionField Last Test 2017-12-12 12:49:02 -05:00
=
29935c2d33 Test Last works 2017-12-12 12:33:32 -05:00
=
de59d26968 Test: erro if last is greater than max - plus fix wrong variable 2017-12-12 12:24:11 -05:00
=
62c0694901 models.DateField corresponds to graphene Date Scalar 2017-12-05 15:04:29 -05:00
Syrus Akbary
5661db88d1
Merge pull request #156 from aaxelb/master
Fix #87: Don't create duplicate Enums for fields with choices
2017-11-14 21:14:51 -08:00
Abram Booth
be20450a66 Don't break on inherited choices fields.
Store converted Django fields in the registry, so choices enums are not
created multiple times when inherited by child models.
2017-08-24 12:49:02 -04:00
Syrus Akbary
3d58148f03 Code adapted to new resolver API 2017-07-28 09:43:27 -07:00
Syrus Akbary
48bcccdac2 Improved integration with Graphene 2.0 2017-07-24 22:27:50 -07:00
Syrus Akbary
7263485225 Merge pull request #194 from dvdmgl/173-annotation-bug
Fix graphene 1.3 annotation bug
2017-06-28 20:53:01 -07:00
David Miguel
b3c761b1c8 Fix graphene 1.3 annotation bug
Issue #173
2017-06-06 19:19:29 +01:00
arianon@openmailbox.org
4350582c52 Support Connections created from Promises 2017-05-19 19:12:28 -04:00
Syrus Akbary
46a1ddedd8 Added RELAY_CONNECTION_MAX_LIMIT and RELAY_CONNECTION_ENFORCE_FIRST_OR_LAST settings
Relay connections will be limited to 100 records by default.
2017-04-15 02:15:17 -07:00
Syrus Akbary
cc03da0598 Moved tests to filter field tests 2017-04-15 01:17:53 -07:00
Syrus Akbary
5833cb83be Fixed filterset limit issue 2017-04-15 01:00:02 -07:00