Commit Graph

910 Commits

Author SHA1 Message Date
Mark Chackerian
8ca7b855ac more flake8 fixes 2018-07-16 18:31:32 -04:00
Mark Chackerian
c076412ba5 automatically generated linting fixes 2018-07-16 18:20:04 -04:00
Mark Chackerian
fc3dbf0963 Merge branch 'master' into issue-703
# Conflicts:
#	graphene/__init__.py
#	graphene/types/__init__.py
2018-07-16 17:50:41 -04:00
Mark Chackerian
0fdc2ca3eb should fix some import issues with python 2.7 2018-07-16 17:20:49 -04:00
Syrus Akbary
319605bfaf
Merge branch 'master' into sdr/subclass_mutations 2018-07-09 18:49:07 -07:00
Daniel Gallagher
142f4a58d8 Run black formatter via pre-commit on all files 2018-07-06 14:03:15 -07:00
Daniel Gallagher
086f9dda99 Run black formatter via pre-commit on all files 2018-07-06 12:09:23 -07:00
Sébastien Diemer
181e75c952 Fetch fields from parent classes in mutations
The goal of this commit is to be able to subclass mutations like this:

```
    class BaseMutation(graphene.Mutation):
        class Arguments:
            name = graphene.String()

        def mutate(self, info, **kwargs):
            # do something

    class ChildMutation(BaseMutation):
        class Arguments(BaseMutation.Arguments):
            other_arg = graphene.String()

        def mutate(self, info, **kwargs):
            # do other things
```

Note:
    vars(x).get(key, gettattr(x, key)) is used instead of the
    simpler gettatrr(x, key) for python2.7 compat.
    Indeed python2 and python3 lead to different results for

    class Foo(object):
        def bar(self):
            pass
    getattr(Foo, 'bar')

    # python 2.7 : > unbound method bar
    # python 3.x : > function Foo.bar
2018-07-02 10:03:39 +02:00
Sébastien Diemer
9f366e93c6 __wip__ add failed test
Just to ease review.
TODO: merge with next commit.
2018-07-02 10:03:39 +02:00
Syrus Akbary
2e41db8d95
Merge pull request #786 from jkimbo/deduplicator
Deduplicator
2018-07-01 18:10:36 -07:00
Jonathan Kim
1e40eceab3 Convert inputs to OrderedDicts 2018-07-01 21:19:19 +01:00
Jonathan Kim
9ce78e32a5 Remove utf-8 characters 2018-07-01 21:11:00 +01:00
Jonathan Kim
1f541e4467 Add crunch utility 2018-07-01 21:09:12 +01:00
Jonathan Kim
56000394c4 Simplify code 2018-07-01 11:32:16 +01:00
Jonathan Kim
cbcaac66d0 Add deduplicator utility 2018-07-01 11:29:45 +01:00
Jonathan Kim
81419de5bf
Update to v2.1.2 2018-06-12 21:48:52 +01:00
Dan
12ee52a13a Add pyupgrade pre-commit hook and run on all files (#736) 2018-06-09 14:01:29 +01:00
Dan
1b3e7f3b96 Add flake8 pre-commit hook and manually edit files to pass flake8 validation (#746)
Add flake8 pre-commit hook and manually edit files to pass flake8 validation
2018-06-05 21:47:07 +01:00
Jeremiah Lowin
00ccc2056b Don't overwrite fields on InputObject - closes #720 2018-05-31 21:52:35 -04:00
Kurtis Jantzen
d6a81ee7ff Update tests to reflect changes 2018-05-30 17:06:43 -06:00
Kurtis Jantzen
aa0c401cb5 Resolve #750 by editing assert message 2018-05-30 16:56:42 -06:00
Dan Palmer
4e59cf3ea6
Fix warning output
Warning filtering is the responsibility of the application, not a library, and this current use causes all warnings from an application (at least those after this function is evaluated the first time) to print their contents.

This makes the library a better citizen in the Python ecosystem, and more closely matches what developers would expect.

(For what it's worth, we also can't start using this library without this patch because the logging is too verbose and may obscure more important warnings. We depend on being able to accurately control warning and logging output)
2018-05-30 14:50:22 +01:00
Dan
034b5385a5 Add isort precommit hook & run on all files (#743)
* Add isort and seed-isort-config pre-commit hook

* Fix erroneous isort moving comment to the top of file
2018-05-28 19:18:54 +01:00
Jonathan Kim
ec9526d0cd Updated version to 2.1.1 2018-05-25 17:17:20 +01:00
Nikordaris
034765aebe Added partial support to Dynamic type (#725) 2018-05-25 16:20:22 +01:00
Daniel Gallagher
9777184721 Add pre-commit tool to repository, and run on all files 2018-05-22 10:56:58 -07:00
Mark Chackerian
de050fa6db fix linting error 2018-05-15 12:09:12 -04:00
Mark Chackerian
d40ef4be2b adds Decimal to types __all__ 2018-05-15 11:42:43 -04:00
Mark Chackerian
49258193ed adds decimal type and associated tests 2018-05-15 11:36:08 -04:00
Syrus Akbary
9408ba70d1 Fields default_value are no longer dismissed. Fixed #702. 2018-04-07 15:31:04 -07:00
Syrus Akbary
05d7e61b84 Updated version to 2.1.0 2018-03-29 22:38:51 -07:00
Syrus Akbary
50cd43c6e5 Added Date, DateTime and Time to global exports 2018-03-29 22:31:36 -07:00
Syrus Akbary
85e354c139 Merge branch 'master' into feature/date-improvements
# Conflicts:
#	graphene/types/datetime.py
2018-03-29 22:10:18 -07:00
Syrus Akbary
b4255e55fd Use aniso8601 instead of iso8601 2018-03-29 22:05:12 -07:00
Syrus Akbary
d46d8e8c33 Allow mutations to be required. Improved testing. Fixed #694 2018-03-21 21:31:56 -07:00
Syrus Akbary
562cafc14f Fixed str on abstract types. Improved repr 2018-03-21 21:21:03 -07:00
Syrus Akbary
415b71f730
Merge pull request #679 from anisjonischkeit/patch-1
Made DateTime types return GraphQLError on fail
2018-03-20 20:26:46 -07:00
abawchen
a96ed550bd Fix deprecations url in DeprecationWarning message. 2018-03-20 08:14:59 +08:00
Syrus Akbary
2594cdb614 Fixed Meta included in Enum members. Fixed #685 2018-03-14 22:15:24 -07:00
Anis Jonischkeit
9973fd314f added tests for when bad input is passed into date/datetime/time fields 2018-03-14 13:06:10 +10:00
Anis Jonischkeit
2a67ffeb35 fixed function name for test to be what it is actually testing and prevent name colision 2018-03-14 12:51:34 +10:00
Anis Jonischkeit
1a1efbd77d
linting: added two lines after end of class 2018-02-27 10:21:41 +10:00
Anis Jonischkeit
84fbf5dc23
Made DateTime types return GraphQLError on fail
This change makes it so that when an incorrectly formatted date string gets passed to a Date / Time argument a GraphQLError is returned rather than a GraphQLLocatedError. Since Date / Time are types, their errors should not be in the same class as errors in your application. This is also inline with how other types work in graphene (graphene.Int, graphene.Float)
2018-02-27 10:00:20 +10:00
Jonathan Kim
c25bcb3345 Move NonNull check 2018-02-17 21:50:40 +00:00
Jonathan Kim
38baf7ab52 Handle relay connection field being required 2018-02-17 20:18:55 +00:00
Jonathan Kim
42c96a453f Added failing test 2018-02-17 20:18:49 +00:00
Syrus Akbary
0971a05b33 Improved support / assertion for graphql types in Schema 2018-02-09 10:49:08 -08:00
Syrus Akbary
a7a4ba62af
Enabled possibility of setting name, description or deprecation_reason in mutation Fields
Fixed  #634, $660 #626 and #593
2018-02-08 23:56:13 -08:00
Pi Delport
368a2a02fe (Fit line length < 120) 2018-02-08 01:26:27 +02:00
Pi Delport
4fa0df401a Fix broken GitHub link tags: 2.0 -> v2.0.0 2018-02-05 16:49:16 +02:00
Syrus Akbary
a0fc843513
Merge pull request #641 from presencelearning/issue-610-connection-name
Allow ObjectType to set Connection name
2018-01-20 15:37:46 -08:00
Roman Fursov
9dde259f54 Change .title method to .capitalize in to_camel_case in str_convertes.py 2018-01-10 17:25:15 +03:00
Brian Chapman
a2178dc220 Allow ObjectType to set Connection name 2018-01-08 09:16:02 -08:00
Syrus Akbary
38db32e4f2
Merge pull request #630 from dfee/425-extended
extended support for subclassing with meta to Enum and InputObjectType
2017-12-26 17:50:13 +00:00
Jonathan Kim
d6968c2e92 Raise better error if type is missing from schema 2017-12-20 18:43:51 +00:00
Devin Fee
a16c5ba00b extended support for subclassing with meta to Enum and InputObjectType 2017-12-16 21:49:23 -08:00
Syrus Akbary
e71a52140a
Update __init__.py 2017-11-14 23:25:30 -08:00
Syrus Akbary
eb5108f81e Simplified inputobjecttype implementation+tests 2017-11-14 22:19:22 -08:00
Syrus Akbary
6dd9e5ff1f Merge branch 'master' into input-fixes 2017-11-14 22:08:56 -08:00
Syrus Akbary
f6697188ee Added tests for nested inputobjecttypes 2017-11-14 22:06:28 -08:00
Nathaniel Parrish
b2151d62da Code cleanup 2017-11-07 09:10:41 -08:00
Nathaniel Parrish
9c27db7ed5 Handle complex input types 2017-11-07 09:06:36 -08:00
Nathaniel Parrish
b5abccb1dc Set all fields on input object types 2017-11-03 16:36:36 -07:00
Syrus Akbary
3ee94131ae Improved object container initialization. Fixed #585 2017-11-02 21:57:10 -07:00
Syrus Akbary
045d5fffbe Added Date type in datetime 2017-11-02 21:17:06 -07:00
Syrus Akbary
43cda1d46a Added extra test to objecttypes 2017-11-02 21:07:10 -07:00
Eran Kampf
90272e5297 Increase test coverage 2017-10-30 10:31:13 -07:00
Eran Kampf
e1f8480b32 lint fix 2017-10-30 10:26:42 -07:00
Eran Kampf
16c80c173e Support from_enum description lambda 2017-10-30 10:24:36 -07:00
Syrus Akbary
d65e431619 Bump Graphene to 2.0 🎉 2017-10-25 10:40:58 -07:00
Syrus Akbary
fcef703eb5 Fixed flake8 issues 2017-10-25 10:27:50 -07:00
Syrus Akbary
2cc701f444 Improved is_node checks 2017-09-06 17:51:09 -07:00
Syrus Akbary
ab5a11b399 Fixed Argument comparison. Fixed #530 2017-08-29 20:21:17 -07:00
Syrus Akbary
f68682e153 Improved mutation examples 2017-08-29 19:53:24 -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
0a97deaa4d Improved relay coverage 2017-08-01 23:55:39 -07:00
Syrus Akbary
7e901f83ae Improved test coverage 2017-08-01 23:39:27 -07:00
Syrus Akbary
7f33fbe638 Fixed field source tests 2017-08-01 15:24:31 -07:00
Syrus Akbary
10a3e86cc5 Fixed mutation payload name and added tests for covering it. 2017-08-01 15:24:22 -07:00
Syrus Akbary
d8fac58701 Fixed source resolver and added tests for it 2017-08-01 13:59:18 -07:00
Syrus Akbary
81018268aa Added support for wheel distributions. Fixed #505 2017-07-31 22:30:13 -07:00
Syrus Akbary
7f1c2a654b Fixed benchmark tests 2017-07-31 22:15:26 -07:00
Syrus Akbary
6a85507325 Improved get_node API 2017-07-27 20:06:48 -07:00
Syrus Akbary
394a1beb07 Updated resolver api 2017-07-27 02:55:25 -07:00
Syrus Akbary
66390554d9 Improved resolver consistency 2017-07-26 23:14:32 -07:00
Syrus Akbary
5c58d9e686 Fixed lazy type instant resolved with NonNull. Fixed #494 2017-07-26 22:32:37 -07:00
Syrus Akbary
6dde81ee65 Improved Mutation warning 2017-07-26 19:44:17 -07:00
Syrus Akbary
c7c611266b Allow types to be abstract 2017-07-26 19:26:54 -07:00
Syrus Akbary
e71b59a8c3 Fixed flake8 issues in mutation 2017-07-24 23:15:56 -07:00
Syrus Akbary
eabb9b202c Added UUID type 2017-07-24 23:09:59 -07:00
Syrus Akbary
ed4bcce0cf Improved Relay Mutation 2017-07-24 23:09:52 -07:00
Syrus Akbary
7ca5c2225f Added create_type. Support for Meta as dict 2017-07-24 21:33:08 -07:00
Syrus Akbary
dba6256578 Changed version to 2.0.dev 2017-07-23 23:43:08 -07:00
Syrus Akbary
df58b9a48b Remove _is_annotated flag from annotate decorator 2017-07-23 23:30:56 -07:00
Syrus Akbary
9769612a44 Make resolvers simple again 2017-07-23 23:10:15 -07:00
Syrus Akbary
40a15bdd21 Improved test coverage 2017-07-23 20:56:00 -07:00
Syrus Akbary
907a3d9915 Fixed Python 3.5 issues 2017-07-23 19:43:58 -07:00
Syrus Akbary
6c4f4624e3 Fixed Python 2/3 issues and flake syntax issues 2017-07-23 19:30:13 -07:00
Syrus Akbary
85d3145862 Improved abstract type 2017-07-23 19:13:33 -07:00
Syrus Akbary
6ae9717415 Improved automatic resolver args from annotations 2017-07-23 18:57:17 -07:00
Syrus Akbary
fb4b4df500 Added auto resolver function 2017-07-23 17:55:26 -07:00
Syrus Akbary
b185f4cae7 Improved mutation with thenable check 2017-07-23 17:36:20 -07:00
Syrus Akbary
b892eee0ae Removed unnecessary files 2017-07-23 17:22:12 -07:00
Syrus Akbary
d2f1024d81 Added annotated resolver and context 2017-07-23 17:19:45 -07:00
Syrus Akbary
f7fdc9aa3d Initial version of function annotations 2017-07-23 16:08:48 -07:00
Syrus Akbary
26686da30e Added inputobjecttype containers 2017-07-23 15:17:10 -07:00
Syrus Akbary
8ff3380291 Removed testing in Python 3.4 and start testing in 3.6 2017-07-12 21:58:05 -07:00
Syrus Akbary
ec5697b185 Fixed Connection side effects and add into breaking changes. 2017-07-12 21:53:35 -07:00
Syrus Akbary
f1624af08a Fixed Flake issues 2017-07-12 21:45:06 -07:00
Syrus Akbary
3fbc3281a2 Fixed Python 3.5 issues with Enum 2017-07-12 21:41:57 -07:00
Syrus Akbary
6321c52bd2 Fixed Connection tests 2017-07-12 21:21:16 -07:00
Syrus Akbary
a023aeba62 Simplified Node type 2017-07-12 01:58:32 -07:00
Syrus Akbary
7a6d741531 Fixed relay ClientIDMutation 2017-07-12 01:36:44 -07:00
Syrus Akbary
4820a7fede Improved Mutation 2017-07-12 00:33:50 -07:00
Syrus Akbary
563ca23d00 Make init_subclass work in Python 3.5 2017-07-12 00:04:37 -07:00
Syrus Akbary
28c987bdd1 Improved docs for extending Option attrs 2017-07-11 23:07:20 -07:00
Syrus Akbary
9ce1288e12 Improved Enum implementation 2017-07-11 22:33:30 -07:00
Syrus Akbary
3604c8f172 Improved mutation class 2017-07-11 21:43:25 -07:00
Syrus Akbary
858343a8f6 Removed unused functions 2017-07-11 21:33:03 -07:00
Syrus Akbary
02c203f748 Simplified Union implementation 2017-07-11 21:31:38 -07:00
Syrus Akbary
b78b8c4134 Removed unused code 2017-07-11 21:27:20 -07:00
Syrus Akbary
f0edcb224a Removed AbstractType 2017-07-11 21:23:39 -07:00
Syrus Akbary
2d557d6ed7 Simplified mutation 2017-07-11 21:16:41 -07:00
Syrus Akbary
d8b42dd1ca Simplified InputObjectType 2017-07-11 20:59:44 -07:00
Syrus Akbary
5ee6e2b8e7 Simplified Scalar 2017-07-11 20:59:02 -07:00
Syrus Akbary
e487206818 Simplified ObjectType logic 2017-07-11 20:53:49 -07:00
Syrus Akbary
c98d91ba1c Simplified Interface code 2017-07-11 20:33:03 -07:00
Syrus Akbary
f22504c2fc Improved Mutation with custom Field and output 2017-06-29 23:46:58 -07:00
Syrus Akbary
078230ad49 Updated version to 1.4.1 2017-06-27 22:00:56 -07:00
Syrus Akbary
985252920c Fixed argument output name. Fixed #490 2017-06-24 12:46:51 -07:00
Syrus Akbary
c41b183fad Fixed lint in graphene.test 2017-06-24 12:24:20 -07:00
Syrus Akbary
6c2b940a03 Improved ClientIDMutation tests for thenables 2017-06-24 12:23:56 -07:00
Syrus Akbary
645bfddfe9 Improved Test Framework to support promises as returned GraphQL execution 2017-06-16 11:09:36 -07:00
Daniel Johnston
83857bfcfe Fixed typo. 2017-05-05 14:38:46 -07:00
Daniel Johnston
388253ede4 Added type consistency. 2017-05-05 14:27:46 -07:00
Daniel Johnston
7642644d82 Removed white space. 2017-05-05 14:23:51 -07:00
Daniel Johnston
59f4ddcd94 Removed white space. 2017-05-05 14:23:21 -07:00
Syrus Akbary
8cae7bd16f Updated version to 1.4.0 2017-04-20 00:55:13 -07:00
Syrus Akbary
a7511d3a2c Added possible_types option to ObjectType.Meta 2017-04-14 22:32:12 -07:00
Syrus Akbary
b8323ed8e7 Merge pull request #446 from graphql-python/features/improved-enums
Improved enums comparison and getters
2017-04-12 23:26:52 -07:00
Syrus Akbary
e92b03bed5 Allow Node inner types to be lazy. Fixed #437 2017-04-12 23:23:44 -07:00
Syrus Akbary
6c040e68a2 Fixed six import 2017-04-10 16:18:52 -07:00
Syrus Akbary
917dc16ea6 Fixed format_error 2017-04-10 16:10:35 -07:00
Syrus Akbary
dfcd7f2563 First version of the Graphene test client and snapshots 💪 2017-04-09 21:08:35 -07:00
Syrus Akbary
afed25a180 Improved enums comparison and getters. Fixed #444 2017-04-07 22:02:16 -07:00
Syrus Akbary
aaf9e92d24 Updated version to 1.3.0 💪 2017-04-06 22:20:56 -07:00
Syrus Akbary
4b71465922 Improved lazy types support in Graphene
This commit also adds support for string types in Field, InputField, List and NonNull, where the string will be import. Usage like: Field("graphene.String")
2017-04-06 22:13:06 -07:00
Syrus Akbary
bd0d418986 Fixed promisify 2017-04-05 16:27:17 -07:00
Yue Gong
3822d6568e Update module_loading documents 2017-03-25 17:59:01 +08:00