mirror of
https://github.com/graphql-python/graphene.git
synced 2025-02-02 20:54:16 +03:00
Merge pull request #675 from jkimbo/fix-type-in-example
Fix kwarg name in example. Fixes #533
This commit is contained in:
commit
5df134e096
|
@ -55,12 +55,12 @@ Example of a custom node:
|
||||||
return '{}:{}'.format(type, id)
|
return '{}:{}'.format(type, id)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def get_node_from_global_id(info, global_id, only_node=None):
|
def get_node_from_global_id(info, global_id, only_type=None):
|
||||||
type, id = global_id.split(':')
|
type, id = global_id.split(':')
|
||||||
if only_node:
|
if only_type:
|
||||||
# We assure that the node type that we want to retrieve
|
# We assure that the node type that we want to retrieve
|
||||||
# is the same that was indicated in the field type
|
# is the same that was indicated in the field type
|
||||||
assert type == only_node._meta.name, 'Received not compatible node.'
|
assert type == only_type._meta.name, 'Received not compatible node.'
|
||||||
|
|
||||||
if type == 'User':
|
if type == 'User':
|
||||||
return get_user(id)
|
return get_user(id)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user