Commit Graph

968 Commits

Author SHA1 Message Date
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
dependabot[bot]
32667b5407
Bump django from 3.1.8 to 3.1.14 in /examples/cookbook (#1283)
Bumps [django](https://github.com/django/django) from 3.1.8 to 3.1.14.
- [Release notes](https://github.com/django/django/releases)
- [Commits](https://github.com/django/django/compare/3.1.8...3.1.14)

---
updated-dependencies:
- dependency-name: django
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-12-10 12:58:03 +03:00
Chouaib Lammas
ef9d67302e
Fix ingredient model (#1258)
Add the required positional argument: 'on_delete'
2021-12-10 12:51:10 +03:00
dependabot[bot]
1e4b03b975
Bump django from 3.1.8 to 3.1.14 in /examples/cookbook-plain (#1282)
Bumps [django](https://github.com/django/django) from 3.1.8 to 3.1.14.
- [Release notes](https://github.com/django/django/releases)
- [Commits](https://github.com/django/django/compare/3.1.8...3.1.14)

---
updated-dependencies:
- dependency-name: django
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-12-10 12:49:16 +03:00
Paul Bailey
e7f7d8da07
Add missing auto fields (#1212)
* add missing auto fields

* add missing auto fields

* skip small auto field sometimes

* make small auto optional

* make small auto optional
2021-06-11 13:41:02 -07:00
Rainshaw
623d0f219e
update js version (#1188) 2021-04-20 23:05:46 -07:00
Eero Ruohola
608af578d4
Fix broken form.save() call in DjangoFormMutation.perform_mutate (#1155)
Django's plain (non-model) forms don't have the `save` method, so
calling this would just result in an `AttributeError` before this
change.

Resolves #1152
2021-04-10 20:30:15 -07:00
dependabot[bot]
26a851a523
Bump django from 3.1.6 to 3.1.8 in /examples/cookbook-plain (#1157)
Bumps [django](https://github.com/django/django) from 3.1.6 to 3.1.8.
- [Release notes](https://github.com/django/django/releases)
- [Commits](https://github.com/django/django/compare/3.1.6...3.1.8)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-10 19:28:41 -07:00
dependabot[bot]
762eaabd04
Bump django from 3.1.6 to 3.1.8 in /examples/cookbook (#1156)
Bumps [django](https://github.com/django/django) from 3.1.6 to 3.1.8.
- [Release notes](https://github.com/django/django/releases)
- [Commits](https://github.com/django/django/compare/3.1.6...3.1.8)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-10 19:28:12 -07: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
Kuba Misiorny
3cf940d0c8
Add ability to pass execution_context_class to GraphQLView.as_view() (#1109)
* Add ability to pass `execution_context_class` to `GraphQLView.as_view()`

Currently when passing `execution_context_class` like this:

```
GraphQLView.as_view(execution_context_class=CustomContext)
```

you get the following error from `View.as_view()`
```
TypeError: GraphQLView() received an invalid keyword 'execution_context_class'. as_view only accepts arguments that are already attributes of the class.
```

this PR fixes the `hasattr` check in `.as_view`.

Fixes: #1072

* make black happy

removed whitespace
2021-03-31 10:31:20 -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
dependabot[bot]
594ca6e25e
Bump django from 3.0.7 to 3.1.6 in /examples/cookbook (#1150)
Bumps [django](https://github.com/django/django) from 3.0.7 to 3.1.6.
- [Release notes](https://github.com/django/django/releases)
- [Commits](https://github.com/django/django/compare/3.0.7...3.1.6)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-20 22:38:50 -07:00
dependabot[bot]
573d38e13e
Bump django from 3.0.7 to 3.1.6 in /examples/cookbook-plain (#1149)
Bumps [django](https://github.com/django/django) from 3.0.7 to 3.1.6.
- [Release notes](https://github.com/django/django/releases)
- [Commits](https://github.com/django/django/compare/3.0.7...3.1.6)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-20 22:38:38 -07:00
Tonye Jack
212524fd8c
Cleaned up unused imports and variables. (#1146)
* Cleaned up used imports and variables.
* Optimized imports.
* Fixed mixed imports.
2021-03-18 12:26:02 +03:00
Sebastián Sastoque H
fe66b48d38
Fix main branch tests failing due to wrong instancing of Missing class (#1135)
Co-authored-by: Sebastian Hernandez <sebastian@rhinoafrica.com>
2021-03-02 10:46:35 -08: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
Thomas Leonard
6046a710c8
fix: declaration of required variable in filters v3 (#1137)
* fix: declaration of required variable

* Add unit test

* Fix formating

Co-authored-by: Thomas Leonard <thomas@loftorbital.com>
2021-02-26 14:44:43 -08:00
Sebastián Sastoque H
ea593b673f
Fix: Use resolver passed as an attribute (#1131)
Co-authored-by: Sebastian Hernandez <sebastian@rhinoafrica.com>
2021-02-23 09:50:19 -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
andrei-datcu
5ce4553244
Fix schema dump on windows (#1123)
Without explicitly setting the encoding to "utf-8" I get the following error on windows (python 3.9)

```
  File "D:\env\lib\site-packages\graphene_django\management\commands\graphql_schema.py", line 115, in handle
    self.get_schema(schema, out, indent)
  File "D:\env\lib\site-packages\graphene_django\management\commands\graphql_schema.py", line 72, in get_schema
    self.save_graphql_file(out, schema)                                                                                   
  File "D:\env\lib\site-packages\graphene_django\management\commands\graphql_schema.py", line 59, in save_graphql_file      
    outfile.write(print_schema(schema.graphql_schema))                                                                    
  File "C:\Users\u\AppData\Local\Programs\Python\Python39\lib\encodings\cp1252.py", line 19, in encode 
    return codecs.charmap_encode(input,self.errors,encoding_table)[0]
```
2021-02-22 20:20:59 -08:00
Yves-Gwenael Bourhis
007768b454
Fix subscriptions in JS (#1124) 2021-02-22 20:19:20 -08:00
Jiahao Li
beb2e4aae3
Doc clarification for headers arg in testing utils (#1117)
I think it might be helpful to add an explicit hint that HTTP headers should be prepended with `HTTP_` as required by `django.test.Client` (at least it was not super obvious to me when I tried to use it).
2021-02-22 20:13:49 -08:00
Tonye Jack
52880166bd
Remove unused imports (#1127)
* Remove unused imports

* Update converter.py
2021-02-22 20:10:30 -08:00
Jason Kraus
4573d3db53
Fix test main (#1126)
Co-authored-by: Thomas Leonard <thomas@loftorbital.com>
2021-02-20 14:26:06 -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
Lucas
5dea6ffa41
Support "contains" and "overlap" filtering (v3) (#1101)
* Support contains/overlap filters

* Remove unused fixtures
2021-01-18 21:39:22 -08:00
Jason Kraus
bcc7f85dad
Add BlankField and mount enums using it v3 (#1096)
* Add BlankField and mount enums using it

* fix lint error from duplicate import

Co-authored-by: Jonathan Kim <jkimbo@gmail.com>
2021-01-11 16:34:50 -08:00
Thomas Leonard
10e48c27b7
Validate in and range filter inputs (#1090)
Co-authored-by: Thomas Leonard <thomas@loftorbital.com>
2021-01-09 19:15:21 -08:00
Ülgen Sarıkavak
ea84827ab8
Fix backward compability on GraphQLTestCase._client setter (#1094) 2021-01-09 19:14:54 -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
8324d47999 Merge branch 'v2' into main 2020-12-30 22:31:41 -08:00
Ülgen Sarıkavak
40e5252936
Use the Django TestCase's Client (#1084)
* Use the Django Client test utility instance that Django provides with its TestCase class. This allows GraphQL tests to make use of the stateful client methods like login()

* Add missing test case initializer call

* Don't break backward compability

* Add test for pending deprecation warning on GraphQLTestCase._client

Co-authored-by: Tom Nightingale <tom@tnightingale.com>
2020-12-30 21:12:24 -08:00
Thiago Bellini Ribeiro
8c48516093
Also convert BaseCSVFilter for custom fields (#1081) 2020-12-30 21:03:57 -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