Skip to content

Commit

Permalink
style: Fixed lint errors, and black formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
abhinand-c committed Mar 2, 2023
1 parent 10802e4 commit f09248f
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/graphql/utilities/coerce_input_value.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,18 @@ def coerce_input_value(
if is_iterable(input_value):
coerced_list: List[Any] = []
append_item = coerced_list.append
is_nested_list = bool(is_list_type(item_type) and len(input_value) > 1)
is_nested_list = bool(
is_list_type(item_type) and len(tuple(input_value)) > 1
)
for index, item_value in enumerate(input_value):
if is_nested_list and not is_iterable(item_value):
# All input values should be iterable for multivalued nested list types
# Input values should be iterable for multivalued nested list type
on_error(
path.as_list() if path else Path(path, index, None).as_list(),
item_value,
GraphQLError(f"Expected type '{inspect(item_type)}' to be a list."),
GraphQLError(
f"Expected type '{inspect(item_type)}' to be a list."
),
)
append_item(
coerce_input_value(
Expand Down

0 comments on commit f09248f

Please sign in to comment.