anchor.diff:                                  FragmentType = None
                                   Path = fieldPath
                                   SelectionSet = field.SelectionSet }
  -                        getSelectionSetInfo (ref !visitedFragments) fieldCtx)
  +                        getSelectionSetInfo visitedFragments fieldCtx)
                       |> Option.defaultValue []
                   { Field = field
                     SelectionSet = fieldSelectionSet
  
positive.code:                 else AstError.AsResult (onError directive, path)
              else Success)
  
      let rec private checkDirectivesInSelectionSet (schemaInfo : SchemaInfo) (fragmentDefinitions : FragmentDefinition list) (path : Path) (visitedFragments : string list ref) (selectionSet : Selection list) =
          selectionSet
          |> collectResults (checkDirectivesInValidLocationOnSelection schemaInfo fragmentDefinitions path visitedFragments)
  
      and private checkDirectivesInFragment (schemaInfo : SchemaInfo)  (fragmentDefinitions : FragmentDefinition list) (path : Path) (visitedFragments : string list ref) (frag : FragmentDefinition) =
          let expectedLocation =
              match frag.Name with
              | Some _ -> DirectiveLocation.FRAGMENT_DEFINITION
              | None -> DirectiveLocation.INLINE_FRAGMENT
          let directivesValid =
              frag.Directives
              |> collectResults (validateDirective schemaInfo path expectedLocation (fun d ->
                  match frag.Name with
                  | Some fragName -> sprintf "Fragment definition '%s' has a directive '%s', but this directive location is not supported by the schema definition." fragName d.Name
                  | None -> sprintf "An inline fragment has a directive '%s', but this directive location is not supported by the schema definition." d.Name))
          match frag.Name with
          | Some fragName when List.contains fragName !visitedFragments -> directivesValid
          | _ -> directivesValid @@ checkDirectivesInSelectionSet schemaInfo fragmentDefinitions path visitedFragments frag.SelectionSet
  
      and private checkDirectivesInValidLocationOnSelection (schemaInfo : SchemaInfo) (fragmentDefinitions : FragmentDefinition list) (path : Path) (visitedFragments : string list ref) =
          function
          | Field field ->
              let path = field.AliasOrName :: path
  
negative.code:                     FragmentType = Some (Inline fragType)
                      SelectionSet = fragmentSelectionSet }
              getSelectionSetInfo visitedFragments fragCtx
          | Spread (fragName, _, _) when List.contains fragName visitedFragments ->
              CyclicReferenceToFragment fragName |> List.singleton
          | Spread (fragName, directives, fragType) ->
              let fragCtx =
                  { parentCtx with
                      ParentType = parentCtx.FragmentOrParentType
                      FragmentType = Some (Spread (fragName, directives, fragType))
                      SelectionSet = fragmentSelectionSet }
              getSelectionSetInfo (fragName :: visitedFragments) fragCtx
              
      and private getSelectionSetInfo (visitedFragments : string list) (ctx : SelectionInfoContext) : SelectionInfoKind list =
          // When building the selection info, we should not raise any error when a type referred by the document
          // is not found in the schema. Not found types are validated in another validation, without the need of the
          // selection info to do it. Info types are helpers to validate against their schema types when the match is found.
  