Commit Graph

830 Commits

Author SHA1 Message Date
Eran Kampf
d0cfee5641
Make UUID compatible (Fixed issue #936) (#937)
* Make UUID compatible

* Fix typo

* black code formatting
2019-04-08 14:06:32 -07:00
Andreas Sodeur
7b6dae7fa3 [863] DateTime, Date, and Time now accept datetime.datetime, datetime.date,… (#864)
* DateTime, Date, and Time now accept datetime.datetime, datetime.date, and datetime.time resp. inputs when used as variables

* Added tests and improved resilience against bad DateTime, Date, and Time inputs.

* Fixed string type checks too narrow for py2.7

* fixed some of pre-commit's complaints
2019-03-31 11:57:34 +01:00
Jonathan Kim
ca9188a615 Dict or attr default resolver (#638)
* Add dict_or_attr resolver and set it as default

* Add some tests

* Dry up code

* Updated formatting
2019-03-11 10:24:11 -07:00
Dan
9ae2359b87 Run pre-commit autoupdate to bump versions of precommit hooks, then run them on all files (#913) 2019-03-08 11:09:45 -08:00
Jonathan Kim
d1b1ad733f Ignore flake8 error 2018-12-27 09:39:18 +00:00
cherls
8e53672a1d Add mutation field default arg test 2018-11-05 13:30:09 -05:00
cherls
4d5a091d16 Add default Field description as docstring 2018-11-05 13:30:05 -05:00
Dan Palmer
2a3d92682a
Add descriptions to the fields as well 2018-09-09 18:44:01 +01:00
Dan Palmer
b8ecc3929d
Add basic type documentation for Relay fields
This adds documentation in the API for `PageInfo`s and `Edges`.

This is useful to include in Graphene because `PageInfo` is always the same, and Edges always have the same format, so documentation for both can be created automatically.
2018-09-09 18:19:58 +01:00
Dan Palmer
00d370b228
Expose documentation for Union types 2018-09-08 17:20:39 +01:00
Syrus Akbary
9512528a77 Fixed async funcs 2018-08-31 20:16:12 +02:00
Syrus Akbary
3d41a500c9 Fixed lint & imports 2018-08-31 20:01:03 +02:00
Syrus Akbary
3e5319cf70 Abstract thenables (promise, coroutine) out of relay Connections and Mutations 2018-08-31 19:53:21 +02:00
Dan Palmer
baec6249e5
Fix assertion 2018-08-29 18:10:37 +01:00
Dan Palmer
07ec419578
Fix grammar 2018-08-29 17:31:46 +01:00
Adam Johnson
4f2b278e12 black reformat 2018-08-29 13:07:45 +03:00
Adam Johnson
7dd8305bdf Change deprecated execute() arguments to new ones
Changed in https://github.com/graphql-python/graphql-core/pull/185 , the docs here were out of date, as were the tests.
2018-08-29 12:35:44 +03:00
Mark Chackerian
00cc97875d Merge branch 'master' into issue-703 2018-07-20 10:25:46 -04:00
Syrus Akbary
d28dc68abc Updated requirements to use graphql-core >= 2.1 2018-07-19 14:44:20 -07:00
Sébastien Diemer
1eae96fd43 fix black formatting 2018-07-19 23:28:26 +02:00
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