anchor.diff:          |> collectResults (fun def ->
               let (vars, selectionSet) =
                   match def with
  -                | OperationDefinitionInfo odef -> (Some odef.Definition.VariableDefinitions, odef.SelectionSet)
  -                | FragmentDefinitionInfo fdef -> (None, fdef.SelectionSet)
  +                | OperationDefinitionInfo odef -> (Some odef.Definition.VariableDefinitions, odef.NonCyclicSelectionSet)
  +                | FragmentDefinitionInfo fdef -> (None, fdef.NonCyclicSelectionSet)
               selectionSet |> collectResults (checkInputValue ctx.Schema vars))
   
       let rec private getDistinctDirectiveNamesInSelection (path : Path) (selection : Selection) : (Path * Set<string>) list =
  
positive.code:                         if fieldA.Field.Name <> fieldB.Field.Name then hasSameShape @@ AstError.AsResult(sprintf "Field name or alias '%s' is referring to fields '%s' and '%s', but they are different fields in the scope of the parent type." aliasOrName fieldA.Field.Name fieldB.Field.Name, fieldA.Path)
                          else if fieldA.Field.Arguments <> fieldB.Field.Arguments then hasSameShape @@ AstError.AsResult(sprintf "Field name or alias '%s' refers to field '%s' two times, but each reference has different argument sets." aliasOrName fieldA.Field.Name, fieldA.Path)
                          else
                              let mergedSet = fieldA.SelectionSet |> List.append fieldB.SelectionSet
                              hasSameShape @@ (fieldsInSetCanMerge mergedSet)
                      else hasSameShape))
  
      let internal validateFieldSelectionMerging (ctx : ValidationContext) =
          ctx.Definitions |> collectResults (fun def -> fieldsInSetCanMerge def.SelectionSet)
  
      let rec private checkLeafFieldSelection (selection : SelectionInfo) =
          let rec validateByKind (fieldType : IntrospectionTypeRef) (selectionSetLength : int) =
  
negative.code:                 | _ when selection.FragmentSpreadName.IsSome -> AstError.AsResult(sprintf "Fragment '%s' has type kind %s, but fragments can only be defined in UNION, OBJECT or INTERFACE types." selection.FragmentSpreadName.Value (fragType.Kind.ToString()), selection.Path)
                  | _ -> AstError.AsResult(sprintf "Inline fragment has type kind %s, but fragments can only be defined in UNION, OBJECT or INTERFACE types." (fragType.Kind.ToString()), selection.Path)
              | None -> Success
          fragmentTypeValid @@ (selection.NonCyclicSelectionSet |> collectResults checkFragmentOnCompositeType)
  
      let internal validateFragmentsOnCompositeTypes (ctx : ValidationContext) =
          ctx.Definitions
          |> List.collect (fun def -> def.NonCyclicSelectionSet)
          |> collectResults checkFragmentOnCompositeType
  
      let internal validateFragmentsMustBeUsed (ctx : ValidationContext) =
  