mirror of
https://github.com/graphql-python/graphene.git
synced 2025-09-21 11:22:33 +03:00
Allow custom description in Node.Field and move ID description to ID argument
This commit is contained in:
parent
51163cf0f8
commit
675743fe17
|
@ -48,7 +48,15 @@ class GlobalID(Field):
|
|||
|
||||
|
||||
class NodeField(Field):
|
||||
def __init__(self, node, type=False, deprecation_reason=None, name=None, **kwargs):
|
||||
def __init__(
|
||||
self,
|
||||
node,
|
||||
type=False,
|
||||
deprecation_reason=None,
|
||||
name=None,
|
||||
description=None,
|
||||
**kwargs
|
||||
):
|
||||
assert issubclass(node, Node), "NodeField can only operate in Nodes"
|
||||
self.node_type = node
|
||||
self.field_type = type
|
||||
|
@ -58,9 +66,9 @@ class NodeField(Field):
|
|||
# interface
|
||||
type or node,
|
||||
name=name,
|
||||
description=description,
|
||||
deprecation_reason=deprecation_reason,
|
||||
description="The ID of the object",
|
||||
id=ID(required=True),
|
||||
id=ID(required=True, description="The ID of the object"),
|
||||
)
|
||||
|
||||
def get_resolver(self, parent_resolver):
|
||||
|
|
Loading…
Reference in New Issue
Block a user