Skip to content

Commit bebdf5c

Browse files
committed
Refactored decorators into utils
1 parent dfc2bc4 commit bebdf5c

File tree

4 files changed

+13
-2
lines changed

4 files changed

+13
-2
lines changed

graphene/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
FloatField,
3838
)
3939

40-
from graphene.decorators import (
40+
from graphene.utils import (
4141
resolve_only_args
4242
)
4343

graphene/utils/__init__.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
from .caching import cached_property, memoize
44
from .lazymap import LazyMap
55
from .misc import enum_to_graphql_enum
6+
from .resolve_only_args import resolve_only_args
7+
68

79
__all__ = ['to_camel_case', 'to_snake_case', 'ProxySnakeDict',
8-
'cached_property', 'memoize', 'LazyMap', 'enum_to_graphql_enum']
10+
'cached_property', 'memoize', 'LazyMap', 'enum_to_graphql_enum',
11+
'resolve_only_args']
File renamed without changes.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
from ..resolve_only_args import resolve_only_args
2+
3+
4+
def test_resolve_only_args():
5+
my_data = {'one': 1, 'two': 2}
6+
resolver = lambda *args, **kwargs: kwargs
7+
wrapped = resolve_only_args(resolver)
8+
assert wrapped(None, my_data, None) == my_data

0 commit comments

Comments
 (0)