GraphQL v0.2.0 GraphQL.Execution.Executor

Execute a GraphQL query against a given schema / datastore.

# iex> GraphQL.execute(schema, "{ hello }")
# {:ok, %{hello: "world"}}

Summary

Types

context :: %{schema: GraphQL.Schema.t, fragments: struct, root_value: Map, operation: Map, variable_values: Map, errors: [GraphQL.Error.t]}
operation :: %{kind: :OperationDefintion, operation: atom}
result_data :: {:ok, Map}

Functions

execute(schema, document, root_value \\ %{}, variable_values \\ %{}, operation_name \\ nil)

Specs

execute(GraphQL.Schema.t, GraphQL.Document.t, map, map, String.t) ::
  result_data |
  {:error, %{errors: list}}

Execute a query against a schema.

# iex> GraphQL.execute(schema, "{ hello }")
# {:ok, %{hello: world}}
get_fields(type)
value_from_ast(value_ast, type, variable_values)