anchor.diff:  ﻿namespace FSharp.Data.GraphQL
   
  -open System
   open System.Collections.Generic
   open FSharp.Data.GraphQL.Types
   open FSharp.Data.GraphQL.Execution
   open FSharp.Data.GraphQL.Ast
   open FSharp.Data.GraphQL.Parser
  -open FSharp.Data.GraphQL.Types.Patterns
   open FSharp.Data.GraphQL.Planning
   
  +type ExecutionFunc<'Root> = 
  +    ExecutionPlan * 'Root option * Map<string, obj> option -> Async<GQLResponse>
   
  -type Executor<'Root> (schema: ISchema<'Root>) = 
  +type ExecutionMiddlewareFunc<'Root> = 
  +    ExecutionPlan * 'Root option * Map<string, obj> option -> ExecutionFunc<'Root> -> Async<GQLResponse>
  +
  +type IExecutionMiddleware<'Root> =
  +    abstract member AsyncResolve : ExecutionMiddlewareFunc<'Root>
  +
  +type Executor<'Root>(schema: ISchema<'Root>, middlewares : IExecutionMiddleware<'Root> seq) = 
       let fieldExecuteMap = FieldExecuteMap()
   
       //FIXME: for some reason static do or do invocation in module doesn't work
  
positive.code:             match operationName with
              | Some opname -> this.CreateExecutionPlan(ast, opname)
              | None -> this.CreateExecutionPlan(ast)
          eval(executionPlan, data, defaultArg variables Map.empty)
          
      /// <summary>
      /// Asynchronously executes unparsed GraphQL query AST. Returned value is a readonly dictionary consisting of following top level entries:
  
negative.code:                 let msg = ex.ToString()
                  return prepareOutput(Direct(new Dictionary<string, obj>() :> Output, [msg, []]))
          }
  
      let execute (executionPlan: ExecutionPlan, data: 'Root option, variables: Map<string, obj> option) = 
          eval(executionPlan, data, defaultArg variables Map.empty)
  
      let rec runMiddlewares executionPlan data variables (middlewares : ExecutionMiddlewareFunc<'Root> list) =
          match middlewares with
          | [] -> execute (executionPlan, data, variables)
          | [x] -> x (executionPlan, data, variables) (fun (plan, data, variables) -> runMiddlewares plan data variables [])
          | x :: xs -> x (executionPlan, data, variables) (fun (plan, data, variables) -> runMiddlewares plan data variables xs)
  
      let executeWithMiddlewares (executionPlan: ExecutionPlan, data: 'Root option, variables: Map<string, obj> option) =
          middlewares
          |> Seq.map (fun m -> m.AsyncResolve)
          |> List.ofSeq
          |> runMiddlewares executionPlan data variables
  
      new(schema) = Executor(schema, middlewares = Seq.empty)
  
      new(schema, middlewareFuncs : ExecutionMiddlewareFunc<'Root> seq) = 
          let middlewares = 
              middlewareFuncs 
              |> Seq.map (fun m -> { new IExecutionMiddleware<'Root> with member __.AsyncResolve = m })
          Executor(schema, middlewares = middlewares)
  
      /// <summary>
      /// Asynchronously executes a provided execution plan. In case of repetitive queries, execution plan may be preprocessed 
      /// and cached using `documentId` as an identifier.
      /// Returned value is a readonly dictionary consisting of following top level entries:
      /// - `documentId`: unique identifier of current document's AST, it can be used as a key/identifier of ExecutionPlan as well
      /// - `data`: GraphQL response matching the structure provided in GraphQL query string
      /// - `errors (oprional): contains a list of errors that occurred while executing a GraphQL operation
      /// </summary>
      /// <param name="ast">Parsed GraphQL query string.</param>
      /// <param name="data">Optional object provided as a root to all top level field resolvers</param>
      /// <param name="variables">Map of all variable values provided by the client request.</param>
      /// <param name="operationName">In case when document consists of many operations, this field describes which of them to execute.</param>
      member __.AsyncExecute(executionPlan: ExecutionPlan, ?data: 'Root, ?variables: Map<string, obj>): Async<GQLResponse> =
          executeWithMiddlewares (executionPlan, data, variables)
      
      /// <summary>
      /// Asynchronously executes parsed GraphQL query AST. Returned value is a readonly dictionary consisting of following top level entries:
  