Grapher v0.6.0 Grapher.Executor View Source

Functions for runing queries against a Schema

Link to this section Summary

Functions

Run the specified query against the specified schema with the given arguments. If the specified schema is not found then the function returns :no_schema if the specified query is not found then this function will return :no_query

Link to this section Functions

Link to this function run(query, schema, vars \\ nil) View Source
run(Grapher.name(), Grapher.name(), Grapher.GraphQL.Request.var_data()) ::
  Grapher.GraphQL.Response.t() |
  HTTPoison.Error.t() |
  :no_schema |
  :no_query

Run the specified query against the specified schema with the given arguments. If the specified schema is not found then the function returns :no_schema if the specified query is not found then this function will return :no_query.

Parameters

  • query: The name of the query to be run, if there is no query registered under this name then :no_query will be returned.
  • schema: The name of the schema to run the query against, if there is no schema registered under this name then :no_schema will be returned.
  • vars: A map of variables for the query.

Examples

iex> Executor.run(:query, :schema, %{arg: "value"})
%{val: "response"}