Commit Graph

68 Commits

Author SHA1 Message Date
Jonathan Kim
5b2eb1109a
ObjectType meta arguments (#1219)
* Pass extra kwargs down the meta chain

* Rename name argument to allow custom name

* Reword error message

* Explicitly define kwargs

* Revert change to explicit kwargs

* name -> name_ for Enum __new__ function
2020-06-29 15:26:08 -07:00
Syrus Akbary
49fcf9f2e6
Allow fast ObjectType creation based on dataclasses (#1157)
* Allow fast ObjectType creation based on dataclasses

* Fixed Python 3.8 integration

* Added repr and eq methods to ObjectType containers

* Reformatted code

* Fixed mypy issue

* Removed unused __init__ for ObjectType containers

* Use black in dataclasses

* Use latest black verison on precommit
2020-04-12 17:45:46 -07:00
Syrus Akbary
60a9609b9a
Updated all str.format(…) to f-strings (#1158)
* Updated all str.format(…) to f-strings

This revamps the PR #984

* Pass black

* Fix flake8

* Updated objecttype

* Fix black version
2020-03-14 17:32:44 -07:00
Min ho Kim
e90aa1b712 Fix typos (#1066)
Fixed typos in docs, string literals, comments, test name
2019-09-25 19:57:53 -04:00
Mel van Londen
8e7d76bbce
Graphene v3 following v3 graphql-core (#1048)
* v3.0 - remove Python 2.x from build (#983)

* Change travis to only compile for p3.6+

* Changed tox to only run Python 3.6+

* Changed library classifiers to reflect support in Python 3.6+

* Changed version to 3.0.0 development

In [15]: get_version((3, 0, 0, "alpha", 0))
Out[15]: '3.0.dev20190601212304'

* Reorganize Tests (#985)

We no longer need a dedicated folder for Python3.6+ tests
We no longer need to check six.PY3 in tests

* Upgrade black to 19.3b0 (#987)

* Remove six dependency (#986)

* No one is using func_name

* Remove six simple usages

* Remove six requirement

* Remove `six.with_metaclass` calls

* pytest-asyncio should be a regular dependency now with Py3 move

* Change dependency to graphql-core-next (#988)

* Changed dependencies to core-next

* Converted Scalars

* ResolveInfo name change

* Ignore .venv

* Make Schema compatible with GraphQL-core-next

* Ignore more venv names and mypy and pytest caches

* Remove print statements for debugging in schema test

* core-next now provides out_type and out_name

* Adapt date and time scalar types to core-next

* Ignore the non-standard result.invalid flag

* Results are named tuples in core-next (immutable)

* Enum values are returned as dict in core-next

* Fix mutation tests with promises

* Make all 345 tests pass with graphql-core-next

* Remove the compat module which was only needed for older Py version

* Remove object as base class (not needed in Py 3)

* We can assume that dicts are ordered in Py 3.6+

* Make use of the fact that dicts are iterable

* Use consistent style of importing from pytest

* Restore compatibility with graphql-relay-py v3

Add adpaters for the PageInfo and Connection args.

* Avoid various deprecation warnings

* Use graphql-core 3 instead of graphql-core-next

* Update dependencies, reformat changes with black

* Update graphene/relay/connection.py

Co-Authored-By: Jonathan Kim <jkimbo@gmail.com>

* Run black on setup.py

* Remove trailing whitespace
2019-08-17 17:07:53 -04:00
Ntale Shadik
c96bd680d7 Add interfaces meta argument on Mutations (#1023) 2019-07-24 18:44:22 +01:00
David Anderson
da1359ecca expose livehtml autobuild in Makefile + Add API autodoc (#971)
* expose livehtml autobuild in Makefile

* add API documentation for schema

* document graphene core API

* fixes black lint

* Update graphene/types/union.py

Co-Authored-By: Jonathan Kim <jkimbo@gmail.com>

* Update graphene/types/argument.py

Co-Authored-By: Jonathan Kim <jkimbo@gmail.com>

* Update graphene/types/field.py

Co-Authored-By: Jonathan Kim <jkimbo@gmail.com>

* Update graphene/types/inputfield.py

Co-Authored-By: Jonathan Kim <jkimbo@gmail.com>

* add note about non-functional `interfaces` meta argument in mutation

* update with other virtual environment configuration

* pin autobuild

* format argument example code

* format enum input object and interface examples

* format enum mutation union examples

* revise documentation with imports, capitalization
2019-06-09 15:36:06 -07:00
Daniel Gallagher
086f9dda99 Run black formatter via pre-commit on all files 2018-07-06 12:09:23 -07:00
Syrus Akbary
9408ba70d1 Fields default_value are no longer dismissed. Fixed #702. 2018-04-07 15:31:04 -07:00
Syrus Akbary
3ee94131ae Improved object container initialization. Fixed #585 2017-11-02 21:57:10 -07:00
Syrus Akbary
7eb3ab5747 Fixed Flake8 issues 2017-08-07 20:59:48 -07:00
Syrus Akbary
7cfec55410 Added mypy static checking 2017-08-07 20:48:26 -07:00
Syrus Akbary
c7c611266b Allow types to be abstract 2017-07-26 19:26:54 -07:00
Syrus Akbary
f1624af08a Fixed Flake issues 2017-07-12 21:45:06 -07:00
Syrus Akbary
6321c52bd2 Fixed Connection tests 2017-07-12 21:21:16 -07:00
Syrus Akbary
7a6d741531 Fixed relay ClientIDMutation 2017-07-12 01:36:44 -07:00
Syrus Akbary
b78b8c4134 Removed unused code 2017-07-11 21:27:20 -07:00
Syrus Akbary
2d557d6ed7 Simplified mutation 2017-07-11 21:16:41 -07:00
Syrus Akbary
e487206818 Simplified ObjectType logic 2017-07-11 20:53:49 -07:00
Syrus Akbary
a7511d3a2c Added possible_types option to ObjectType.Meta 2017-04-14 22:32:12 -07:00
Syrus Akbary
48efec307c Improved Options merge attrs. Fixed #432 2017-03-04 18:13:16 -08:00
Syrus Akbary
ad251e9a8d Fix ObjectType special types. Fix #425 2017-02-26 21:09:21 -08:00
Syrus Akbary
98825fa4bc Added optional default_resolver to ObjectType. 2017-02-24 00:02:36 -08:00
Wei Yen
c592e94f73 Use trim_docstring to ensure description has no leading whitespace 2017-02-22 07:03:30 +11:00
Syrus Akbary
8030fea443 Fixed flexible resolving in return type 2016-09-29 01:38:56 -07:00
Syrus Akbary
f955280d1a Improved sorting/PEP8 syntax 2016-09-18 13:23:35 -07:00
Markus Padourek
2975e1fc42 Allow initialising ObjectType with private state. 2016-09-12 15:51:51 +01:00
Syrus Akbary
af9e51e58d Added documentation 2016-08-16 21:32:53 -07:00
Syrus Akbary
f53c26c7ab Simplified fields implementation 2016-08-16 21:12:09 -07:00
Syrus Akbary
fd0b9223cf Made fields logic more clear 2016-08-15 23:19:18 -07:00
Syrus Akbary
6fa32a7287 Fixed PEP8 errors 2016-08-14 16:58:32 -07:00
Syrus Akbary
dbc981c6d2 Fixed runtime type resolution. 2016-08-14 10:20:09 -07:00
Syrus Akbary
99eec49a06 Removed unused code. Small refactor 2016-08-13 23:15:20 -07:00
Syrus Akbary
7804f10732 Added ClientIDMutation. All examples working 💪 2016-08-13 23:00:25 -07:00
Syrus Akbary
e2036da75f Added relay.Connection and relay.ConnectionField 2016-08-13 21:05:45 -07:00
Syrus Akbary
b19bca7f3b Improved base implementation 2016-08-13 17:37:57 -07:00
Syrus Akbary
2696ae9b73 Make new_types the deafult types 2016-08-13 14:43:51 -07:00
Syrus Akbary
04492600e5 First stage separate interfaces 2016-08-08 09:37:06 -07:00
Syrus Akbary
ff3968faea Removed unused function 2016-08-07 17:08:50 -07:00
Syrus Akbary
27a0d4147f Removed implements check 2016-08-07 16:53:40 -07:00
Syrus Akbary
387b997b1d Fixed tests and flake errors 2016-08-06 19:42:06 -07:00
Syrus Akbary
1737089c6d Refactored GraphQL type generator 2016-06-22 23:22:09 -07:00
Syrus Akbary
7d59489183 Remove abstract from options 2016-06-21 23:31:29 -07:00
Syrus Akbary
1827099381 Added get_fields to options 2016-06-21 17:40:38 -07:00
Syrus Akbary
b5458493ce Improved objecttype 2016-06-21 14:09:54 -07:00
Syrus Akbary
c87d87d1ea Improved ObjectType fields 2016-06-21 13:09:14 -07:00
Syrus Akbary
9a9d7f8873 Moved Interface to ObjectType. Improved integration with latest GraphQL-core 2016-06-21 11:54:14 -07:00
Syrus Akbary
b772499b9b Improved Interface/ObjectType is_type_of abstraction 2016-06-19 14:29:41 -07:00
Syrus Akbary
6e38e48faf Improved code lint 2016-06-15 21:40:54 -07:00
Syrus Akbary
8bd9669d3d Removed unused implements 2016-06-15 21:20:35 -07:00