* 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
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.
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
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)