Improved fields

This commit is contained in:
Syrus Akbary 2015-11-11 02:21:25 -08:00
parent cfba52e6f3
commit 2fed5c7e4a

View File

@ -65,8 +65,8 @@ class NodeField(Field):
def __init__(self, object_type=None, *args, **kwargs): def __init__(self, object_type=None, *args, **kwargs):
from graphene.relay.types import Node from graphene.relay.types import Node
kwargs['id'] = ID(description='The ID of an object') id = kwargs.pop('id', None) or ID(description='The ID of an object')
super(NodeField, self).__init__(object_type or Node, *args, **kwargs) super(NodeField, self).__init__(object_type or Node, id=id, *args, **kwargs)
self.field_object_type = object_type self.field_object_type = object_type
def id_fetcher(self, global_id, info): def id_fetcher(self, global_id, info):