Skip to content

Commit 1cba47b

Browse files
committed
Added dynamic input container
1 parent 701a6f7 commit 1cba47b

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

graphql/execution/values.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ def coerce_value(type, value):
157157
# dict if exists
158158
obj[field.out_name or field_name] = field_value
159159

160-
return obj
160+
return type.create_container(obj)
161161

162162
assert isinstance(type, (GraphQLScalarType, GraphQLEnumType)), \
163163
'Must be input type'

graphql/type/definition.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -514,6 +514,9 @@ def __init__(self, name, fields, description=None):
514514

515515
self._fields = fields
516516

517+
def create_container(self, data):
518+
return dict(data)
519+
517520
@cached_property
518521
def fields(self):
519522
return self._define_field_map()

graphql/utils/value_from_ast.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ def value_from_ast(value_ast, type, variables=None):
6464
# dict if exists
6565
obj[field.out_name or field_name] = field_value
6666

67-
return obj
67+
return type.create_container(obj)
6868

6969
assert isinstance(type, (GraphQLScalarType, GraphQLEnumType)), \
7070
'Must be input type'

0 commit comments

Comments
 (0)