Skip to content

Commit 512a24e

Browse files
committed
Simplified directives.
1 parent 9f5b0a4 commit 512a24e

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

graphql/type/directives.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,20 +44,15 @@ def __init__(self, name, description=None, args=None, locations=None):
4444
self.description = description
4545
self.locations = locations
4646

47-
self.args = collections.OrderedDict()
4847
if args:
49-
assert isinstance(args, dict), '{} args must be a dict with argument names as keys.'.format(name)
48+
assert isinstance(args, collections.Mapping), '{} args must be a dict with argument names as keys.'.format(name)
5049
for arg_name, _arg in args.items():
5150
assert_valid_name(arg_name)
5251
assert is_input_type(_arg.type), '{}({}) argument type must be Input Type but got {}.'.format(
5352
name,
5453
arg_name,
5554
_arg.type)
56-
self.args[arg_name] = GraphQLArgument(
57-
type=_arg.type,
58-
description=_arg.description,
59-
default_value=_arg.default_value,
60-
)
55+
self.args = args or collections.OrderedDict()
6156

6257

6358
GraphQLIncludeDirective = GraphQLDirective(

0 commit comments

Comments
 (0)