mirror of
https://github.com/graphql-python/graphene.git
synced 2024-11-11 04:07:16 +03:00
Refactored decorators into utils
This commit is contained in:
parent
dfc2bc4ac3
commit
bebdf5cf9b
|
@ -37,7 +37,7 @@ from graphene.core.fields import (
|
|||
FloatField,
|
||||
)
|
||||
|
||||
from graphene.decorators import (
|
||||
from graphene.utils import (
|
||||
resolve_only_args
|
||||
)
|
||||
|
||||
|
|
|
@ -3,6 +3,9 @@ from .proxy_snake_dict import ProxySnakeDict
|
|||
from .caching import cached_property, memoize
|
||||
from .lazymap import LazyMap
|
||||
from .misc import enum_to_graphql_enum
|
||||
from .resolve_only_args import resolve_only_args
|
||||
|
||||
|
||||
__all__ = ['to_camel_case', 'to_snake_case', 'ProxySnakeDict',
|
||||
'cached_property', 'memoize', 'LazyMap', 'enum_to_graphql_enum']
|
||||
'cached_property', 'memoize', 'LazyMap', 'enum_to_graphql_enum',
|
||||
'resolve_only_args']
|
||||
|
|
8
graphene/utils/tests/test_resolve_only_args.py
Normal file
8
graphene/utils/tests/test_resolve_only_args.py
Normal file
|
@ -0,0 +1,8 @@
|
|||
from ..resolve_only_args import resolve_only_args
|
||||
|
||||
|
||||
def test_resolve_only_args():
|
||||
my_data = {'one': 1, 'two': 2}
|
||||
resolver = lambda *args, **kwargs: kwargs
|
||||
wrapped = resolve_only_args(resolver)
|
||||
assert wrapped(None, my_data, None) == my_data
|
Loading…
Reference in New Issue
Block a user