Webql.Schema.Operation (webql v0.1.0-alpha.1)

Copy Markdown

WebQL schema operations.

Examples

defmodule MyApp.Schema.AddOperation do
  use Webql.Schema.Operation

  operation do
    input :lhs, :int
    input :rhs, :int
    resolve fn params -> {:ok, %{sum: params.l + params.r}} end
    output :sum, :int
  end
end

Options

  • :extensions (list of module that adopts Spark.Dsl.Extension) - A list of DSL extensions to add to the Spark.Dsl

  • :otp_app (atom/0) - The otp_app to use for any application configurable options

  • :fragments (list of module/0) - Fragments to include in the Spark.Dsl. See the fragments guide for more.