anchor.diff:                      else acc @ Error.AsResult(sprintf "Fragment spread '%s' has a directive '%s', but this directive location is not supported by the schema definition." spread.Name directive.Name, path)
                   | None -> acc) acc
   
  -    let private checkDirectivesInOperation (acc : ValidationResult) (schemaInfo : SchemaInfo) (fragmentDefinitions : FragmentDefinition list) (path : Path) (operation : OperationDefinition) =
  +    let private checkDirectivesInOperation (acc : ValidationResult) (schemaInfo : SchemaInfo) (fragmentDefinitions : FragmentDefinition list) (path : Path) (visitedFragments : string list ref) (operation : OperationDefinition) =
           let expectedDirectiveLocation =
               match operation.OperationType with
               | Query -> DirectiveLocation.QUERY
  
positive.code:                 | [] -> acc
                  | results -> List.reduce (@) results) Success
  
      let rec private checkFragmentMustNotHaveCycles (acc : ValidationResult) (fragmentDefinitions : FragmentDefinition list) (visited : string list ref) (frag : FragmentDefinition) =
          frag.Name 
          |> Option.map (fun name ->
              visited := name :: !visited
              if List.contains name !visited
              then acc @ Error.AsResult(sprintf "Fragment '%s' is making a cyclic reference." name)
              else
                  match frag.SelectionSet |> List.map (checkFragmentsMustNotHaveCyclesInSelection acc fragmentDefinitions visited) with
                  | [] -> acc
                  | results -> List.reduce (@) results)
          |> Option.defaultValue acc
  
      and private checkFragmentsMustNotHaveCyclesInSelection (acc : ValidationResult) (fragmentDefinitions : FragmentDefinition list) (visited : string list ref) =
          function
          | Field field -> 
              match field.SelectionSet |> List.map (checkFragmentsMustNotHaveCyclesInSelection acc fragmentDefinitions visited) with
              | [] -> acc
              | results -> List.reduce (@) results
          | InlineFragment frag -> checkFragmentMustNotHaveCycles acc fragmentDefinitions visited frag
          | FragmentSpread spread ->
              visited := spread.Name :: !visited
              if List.contains spread.Name !visited
              then acc @ Error.AsResult(sprintf "Fragment '%s' is making a cyclic reference." spread.Name)
              else
                  match fragmentDefinitions |> List.tryFind (fun f -> f.Name.IsSome && f.Name.Value = spread.Name) with
                  | Some frag -> checkFragmentMustNotHaveCycles acc fragmentDefinitions visited frag
                  | None -> acc
  
      let internal validateFragmentsMustNotFormCycles (ctx : ValidationContext) =
          let fragmentDefinitions = ctx.FragmentDefinitions |> List.map (fun x -> x.Definition)
          fragmentDefinitions |> List.fold (fun acc def -> checkFragmentMustNotHaveCycles acc fragmentDefinitions (ref []) def) Success
  
      let private checkFragmentSpreadIsPossibleInSelection (acc : ValidationResult) (path : Path, parentType : IntrospectionType, fragmentType : IntrospectionType) =
          if not (typesAreApplicable (parentType, fragmentType))
  
negative.code: 
      let internal validateAllVariablesUsed (ctx : ValidationContext) =
          let fragmentDefinitions = getFragmentDefinitions ctx.Document
          let visitedFragments = ref  []
          ctx.Document.Definitions
          |> List.choose (function OperationDefinition def -> Some (def.Name, def.SelectionSet, def.VariableDefinitions) | _ -> None)
          |> List.fold (fun acc (operationName, selectionSet, varDefs) ->
              varDefs |> List.map (fun x -> x.VariableName) |> List.fold (fun acc varName ->
                  let isUsed = selectionSet |> List.fold (fun acc selection -> acc || variableIsUsedInSelection varName fragmentDefinitions visitedFragments selection) false
                  match operationName, isUsed with
                  | _ , true -> acc
                  | Some operationName, _ -> acc @ Error.AsResult(sprintf "Variable definition '%s' is not used in operation '%s'. Every variable must be used." varName operationName)
  