Webql behaviour (webql v0.1.0-alpha.1)

Copy Markdown

Defines and runs WebQL instances.

Examples

defmodule MyApp.Webql do
  use Webql,
    memory: MyApp.Webql.Memory.new/0,
    engine: MyApp.Webql.Engine.new/0
end

Summary

Callbacks

Returns the configured engine instance.

Returns the configured memory instance.

Returns introspection results for a WebQL schema.

Creates a new WebQL instance.

Runs an operation with the given parameters.

Callbacks

__engine__()

@callback __engine__() :: term()

Returns the configured engine instance.

__memory__()

@callback __memory__() :: term()

Returns the configured memory instance.

introspect(dsl)

@callback introspect(dsl :: module()) :: map()

Returns introspection results for a WebQL schema.

new(memory, engine)

@callback new(memory :: term(), engine :: term()) :: term()

Creates a new WebQL instance.

run(webql, source, dsl, params)

@callback run(webql :: term(), source :: binary(), dsl :: module(), params :: map()) ::
  map()

Runs an operation with the given parameters.