mirror of
https://github.com/graphql-python/graphene.git
synced 2025-07-27 08:19:45 +03:00
Dry up code
This commit is contained in:
parent
17c225fda2
commit
b765cc02af
|
@ -7,9 +7,10 @@ def dict_resolver(attname, default_value, root, info, **args):
|
|||
|
||||
|
||||
def dict_or_attr_resolver(attname, default_value, root, info, **args):
|
||||
resolver = attr_resolver
|
||||
if isinstance(root, dict):
|
||||
return dict_resolver(attname, default_value, root, info, **args)
|
||||
return attr_resolver(attname, default_value, root, info, **args)
|
||||
resolver = dict_resolver
|
||||
return resolver(attname, default_value, root, info, **args)
|
||||
|
||||
|
||||
default_resolver = dict_or_attr_resolver
|
||||
|
|
Loading…
Reference in New Issue
Block a user