Collect all Conflicts between two collections of fields.

       This is similar to, but different from the `collect_conflicts_within` function above. This check assumes that
       `collect_conflicts_within` has already been called on each provided collection of fields.
       This is true because this validator traverses each individual selection set.

def _collect_conflicts_between(
    context,  # type: ValidationContext
    conflicts,  # type: List[Tuple[Tuple[str, str], List[Node], List[Node]]]
    cached_fields_and_fragment_names,  # type: Dict[SelectionSet, Tuple[Dict[str, List[Tuple[Union[GraphQLInterfaceType, GraphQLObjectType, None], Field, GraphQLField]]], List[str]]]
    compared_fragments,  # type: PairSet
    parent_fields_are_mutually_exclusive,  # type: bool
    field_map1,  # type: Dict[str, List[Tuple[Union[GraphQLInterfaceType, GraphQLObjectType, None], Field, GraphQLField]]]
    field_map2,  # type: Dict[str, List[Tuple[Union[GraphQLInterfaceType, GraphQLObjectType, None], Field, GraphQLField]]]
):
    # type: (...) -> None
    """Collect all Conflicts between two collections of fields.

       This is similar to, but different from the `collect_conflicts_within` function above. This check assumes that
       `collect_conflicts_within` has already been called on each provided collection of fields.
       This is true because this validator traverses each individual selection set.
    """
    # A field map is a keyed collection, where each key represents a response
    # name and the value at that key is a list of all fields which provide that
    # response name. For any response name which appears in both provided field
    # maps, each field from the first field map must be compared to every field
    # in the second field map to find potential conflicts.
    for response_name, fields1 in list(field_map1.items()):
        fields2 = field_map2.get(response_name)

        if fields2:
            for field1 in fields1:
                for field2 in fields2:
                    conflict = _find_conflict(
                        context,
                        cached_fields_and_fragment_names,
                        compared_fragments,
                        parent_fields_are_mutually_exclusive,
                        response_name,
                        field1,
                        field2,
                    )

                    if conflict:
                        conflicts.append(conflict)