diff --git a/graphene/relay/node.py b/graphene/relay/node.py index 2e20b550..d926fd5c 100644 --- a/graphene/relay/node.py +++ b/graphene/relay/node.py @@ -26,8 +26,8 @@ class NodeMeta(InterfaceTypeMeta): @property def Field(cls): - # We put as a property for reset the field counter each time is setted up, so - # it will be order correctly wherever is mounted + # We put as a property for reset the field counter each time is called + # so it will be order correctly wherever is mounted field = copy.copy(cls._Field) field.reset_counter() return field diff --git a/graphene/types/proxy.py b/graphene/types/proxy.py index c037720c..f66cdde9 100644 --- a/graphene/types/proxy.py +++ b/graphene/types/proxy.py @@ -4,10 +4,25 @@ from ..utils.orderedtype import OrderedType class TypeProxy(OrderedType): + ''' + This class acts a proxy for a Graphene Type, so it can be mounted + as Field, InputField or Argument. + + Instead of doing + >>> class MyObjectType(ObjectType): + >>> my_field = Field(String(), description='Description here') + + You can actually do + >>> class MyObjectType(ObjectType): + >>> my_field = String(description='Description here') + + So is simpler to use. + ''' + def __init__(self, *args, **kwargs): self.args = args self.kwargs = kwargs - OrderedType.__init__(self) + super(TypeProxy, self).__init__() def get_type(self): return self._meta.graphql_type