Liking cljdoc? Tell your friends :D

com.walmartlabs.lacinia


executeclj

(execute schema query variables context)
(execute schema query variables context options)

Given a compiled schema and a query string, attempts to execute it.

Returns a result map with up-to two keys: :data is the main result of the execution, and :errors are any errors generated during execution.

In the case where there's a parse or validation problem for the query, just the :errors key will be present.

schema : GraphQL schema (as compiled by com.walmartlabs.lacinia.schema/compile).

query : Input query string to be parsed and executed.

variables : compile-time variables that can be referenced inside the query using the $variable-name production.

context (optional) : Additional data that will ultimately be passed to resolver functions.

options (optional) : The only option currently is :operation-name, used to identify which operation to execute, when the query specifies more than one.

This function parses the query and invokes execute-parsed-query.

When a GraphQL query contains variables, the values for those variables arrive seperately; for example, a JSON request may have the query in the "query" property, and the variables in the "variables" property.

The values for those variables are provided in the variables parameter. The keys are keyword-ized names of the variable (without the leading '$'); if a variable is named $user_id in the query, the corresponding key should be :user_id.

The values in the variables map should be of a type matching the variable's declaration in the query; typically a string or other scalar value, or a map for a variable of type InputObject.

Given a compiled schema and a query string, attempts to execute it.

Returns a result map with up-to two keys:  :data is the main result of the
execution, and :errors are any errors generated during execution.

In the case where there's a parse or validation problem for the query,
just the :errors key will be present.

schema
: GraphQL schema (as compiled by [[com.walmartlabs.lacinia.schema/compile]]).

query
: Input query string to be parsed and executed.

variables
: compile-time variables that can be referenced inside the query using the
  `$variable-name` production.

context (optional)
: Additional data that will ultimately be passed to resolver functions.

options (optional)
: The only option currently is `:operation-name`, used to identify which
  operation to execute, when the query specifies more than one.

This function parses the query and invokes [[execute-parsed-query]].

When a GraphQL query contains variables, the values for those variables
arrive seperately; for example, a JSON request may have the query
in the "query" property, and the variables in the "variables" property.

The values for those variables are provided in the variables parameter.
The keys are keyword-ized names of the variable (without the leading
'$'); if a variable is named `$user_id` in the query, the corresponding
key should be `:user_id`.

The values in the variables map should be of a type matching the
variable's declaration in the query; typically a string or other scalar value,
or a map for a variable of type InputObject.
raw docstring

execute-parsed-queryclj

(execute-parsed-query parsed-query variables context)

Prepares a query, by applying query variables to it, resulting in a prepared query which is then executed.

Returns a result map (with :data and/or :errors keys).

Prepares a query, by applying query variables to it, resulting in a prepared
query which is then executed.

Returns a result map (with :data and/or :errors keys).
raw docstring

execute-parsed-query-asyncclj

(execute-parsed-query-async parsed-query variables context)

Prepares a query, by applying query variables to it, resulting in a prepared query which is then executed.

Returns a [[ResolverResult]] that will deliver the result map.

Prepares a query, by applying query variables to it, resulting in a prepared
query which is then executed.

Returns a [[ResolverResult]] that will deliver the result map.
raw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close