code: def _find_conflicts_within_selection_set(
      context,
      cached_fields_and_fragment_names,
      compared_fragments,
      parent_type,
      selection_set,
  ):
      """Find all conflicts found "within" a selection set, including those found via spreading in fragments.
  
      Called when visiting each SelectionSet in the GraphQL Document.
      """
      conflicts = []
  
      field_map, fragment_names = _get_fields_and_fragments_names(
          context,
          cached_fields_and_fragment_names,
          parent_type,
          selection_set,
      )
  
      # (A) Find all conflicts "within" the fields of this selection set.
      # Note: this is the *only place* `collect_conflicts_within` is called.
      _collect_conflicts_within(
          context,
          conflicts,
          cached_fields_and_fragment_names,
          compared_fragments,
          field_map,
      )
  
      # (B) Then collect conflicts between these fields and those represented by
      # each spread fragment name found.
      for i, fragment_name in enumerate(fragment_names):
          _collect_conflicts_between_fields_and_fragment(
              context,
              conflicts,
              cached_fields_and_fragment_names,
              compared_fragments,
              False,
              field_map,
              fragment_name,
          )
  
          # (C) Then compare this fragment with all other fragments found in this
          # selection set to collect conflicts within fragments spread together.
          # This compares each item in the list of fragment names to every other item
          # in that same list (except for itself).
          for other_fragment_name in fragment_names[i + 1 :]:
              _collect_conflicts_between_fragments(
                  context,
                  conflicts,
                  cached_fields_and_fragment_names,
                  compared_fragments,
                  False,
                  fragment_name,
                  other_fragment_name,
              )
  
      return conflicts
  
imports: import itertools
  from collections import OrderedDict
  from ...error import GraphQLError
  from ...language import ast
  from ...language.printer import print_ast
  from ...pyutils.pair_set import PairSet
  from ...type.definition import GraphQLInterfaceType, GraphQLList, GraphQLNonNull, GraphQLObjectType, get_named_type, is_leaf_type
  from ...utils.type_comparators import is_equal_type
  from ...utils.type_from_ast import type_from_ast
  from .base import ValidationRule
label_desc: Use image node_id 1 for calling a global function with example usage: _find_conflicts_within_selection_set(context, cached_fields_and_fragment_names, compared_fragments, parent_type, selection_set) and returns: conflicts