graphqexl v0.1.0-alpha-rc.23 Graphqexl.Schema.Executable

Establishes a GenServer to cache the loadedGraphQL schema.

Future improvement: use the GenServer as a basis for hot-reloading

Link to this section Summary

Functions

Returns a specification to start this module under a supervisor.

Handle request messages from external processes for a :get operation, returning the executable schema. Callback for the GenServer's call handling.

Loads, parses and uses :ets to cache the configured schema definition.

Start callback for the GenServer.t/0, taking a single init arg specifying the file path of the GraphQL schema to load and parse.

Link to this section Functions

Link to this function

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

Link to this function

handle_call(msg, arg2, state)

(since 0.1.0)
handle_call(:get, tuple(), term()) :: Graphqexl.Schema.t()

Handle request messages from external processes for a :get operation, returning the executable schema. Callback for the GenServer's call handling.

Returns: Graphqexl.Schema.t/0

Link to this function

init(init_arg)

(since 0.1.0)
init(term()) :: {:ok, nil} | {:error, String.t()}

Loads, parses and uses :ets to cache the configured schema definition.

GenServer.init/1 callback implementation, called at application bootstrap.

Returns: {:ok, nil} when successful {:error, t:String.t/1} when unsuccessful

Link to this function

start_link(init_arg)

(since 0.1.0)
start_link(String.t()) :: {:ok, integer()} | {:error, String.t()}

Start callback for the GenServer.t/0, taking a single init arg specifying the file path of the GraphQL schema to load and parse.

Returns: {:ok, pid} when successful {:error, message} when unsuccessful