def complete_list_value(
    exe_context,  # type: ExecutionContext
    return_type,  # type: GraphQLList
    field_asts,  # type: List[Field]
    info,  # type: ResolveInfo
    path,  # type: List[Union[int, str]]
    result,  # type: Any
):
    # type: (...) -> List[Any]
    """
    Complete a list value by completing each item in the list with the inner type
    """
    assert isinstance(result, Iterable), (
        "User Error: expected iterable, but did not find one " + "for field {}.{}."
    ).format(info.parent_type, info.field_name)

    item_type = return_type.of_type
    completed_results = []
    contains_promise = False

    index = 0
    for item in result:
        completed_item = complete_value_catching_error(
            exe_context, item_type, field_asts, info, path + [index], item
        )
        if not contains_promise and is_thenable(completed_item):
            contains_promise = True

        completed_results.append(completed_item)
        index += 1

    return Promise.all(completed_results) if contains_promise else completed_results
def complete_list_value ( exe_context , return_type , field_asts , info , path , result , ) : assert isinstance ( result , Iterable ) , ( "User Error: expected iterable, but did not find one " + "for field {}.{}." ) . format ( info . parent_type , info . field_name ) item_type = return_type . of_type completed_results = [ ] contains_promise = False index = 0 for item in result : completed_item = complete_value_catching_error ( exe_context , item_type , field_asts , info , path + [ index ] , item ) if not contains_promise and is_thenable ( completed_item ) : contains_promise = True completed_results . append ( completed_item ) index += 1 return Promise . all ( completed_results ) if contains_promise else completed_results
Complete a list value by completing each item in the list with the inner type