FSharp.Data.GraphQL


Schema<'Root>

Namespace: FSharp.Data.GraphQL

GraphQL server schema. Defines the complete type system to be used by GraphQL queries.

Constructors

ConstructorDescription
new(query, mutation, config)
Signature: (query:ObjectDef<'Root> * mutation:ObjectDef<'Root> option * config:SchemaConfig option) -> Schema<'Root>

CompiledName: .ctor

Instance members

Instance memberDescription
AsyncExecute(...)
Signature: (executionPlan:ExecutionPlan * data:'Root option * variables:Map<string,obj> option) -> Async<IDictionary<string,obj>>

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

AsyncExecute(...)
Signature: (queryOrMutation:string * data:'Root option * variables:Map<string,obj> option * operationName:string option) -> Async<IDictionary<string,obj>>

Asynchronously executes unparsed GraphQL query AST. Returned value is a readonly dictionary consisting of following top level entries: - documentId: unique identifier of current document's AST - 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

AsyncExecute(...)
Signature: (ast:Document * data:'Root option * variables:Map<string,obj> option * operationName:string option) -> Async<IDictionary<string,obj>>

Asynchronously executes parsed GraphQL query AST. Returned value is a readonly dictionary consisting of following top level entries: - documentId: unique identifier of current document's AST - 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

CreateExecutionPlan(...)
Signature: (queryOrMutation:string * operationName:string option) -> ExecutionPlan

Creates an execution plan for provided GraphQL query string without executing it. This is useful in cases when you have the same query executed multiple times with different parameters. In that case, query can be used to construct execution plan, which then is cached (using DocumentId as a key) and reused when needed.

CreateExecutionPlan(ast, operationName)
Signature: (ast:Document * operationName:string option) -> ExecutionPlan

Creates an execution plan for provided GraphQL document AST without executing it. This is useful in cases when you have the same query executed multiple times with different parameters. In that case, query can be used to construct execution plan, which then is cached (using DocumentId as a key) and reused when needed.

Fork me on GitHub