Module graphql

Data Types

context()

context() = #{atom() => any()}

defer_map()

defer_map() = #{worker => pid(), timeout => non_neg_integer(), apply => [function()]}

directive()

directive() = #directive{id = graphql:name(), args = #{binary() => term()} | [{any(), any()}], schema = any()}

document()

document() = #document{definitions = [any()]}

enum_type()

enum_type() = #enum_type{id = binary(), description = binary(), resolve_module = mod(), directives = [graphql:directive()], values = #{integer() => enum_value()}}

enum_value()

enum_value() = #enum_value{val = binary(), description = binary(), directives = [graphql:directive()], deprecation = undefined | binary()}

json()

json() = number() | binary() | true | false | null | #{binary() | atom() => json()} | [json()]

mod()

mod() = atom()

param_context()

param_context() = json()

resolver()

resolver() = fun((ctx, term(), binary(), resolver_args()) -> term())

resolver_args()

resolver_args() = #{binary() => term()}

result()

result() = {ok, term()} | {error, term()} | {defer, token()} | {defer, token(), defer_map()}

scalar_type()

scalar_type() = #scalar_type{id = binary(), description = binary(), directives = [graphql:directive()], resolve_module = mod()}

schema_arg()

schema_arg() = #schema_arg{ty = schema_type(), default = any(), description = binary(), directives = [graphql:directive()]}

schema_base_type()

schema_base_type() = scalar_type() | enum_type() | binary()

schema_definition()

schema_definition() = {atom(), #{atom() => term()}}

schema_field()

schema_field() = #schema_field{ty = schema_type(), description = binary() | undefined, resolve = undefined | resolver(), deprecation = undefined | binary(), directives = [graphql:directive()], args = #{binary() => schema_arg()}}

schema_type()

schema_type() = {non_null, schema_base_type()} | {non_null, {list, schema_base_type()}} | {list, schema_base_type()} | schema_base_type()

token()

token() = {'$graphql_token', pid(), reference(), reference()}

Function Index

execute/1
execute/2
format_errors/2
insert_root/1
insert_schema_definition/1insert_schema_definition/1 loads a schema definition into the Graph Schema.
load_schema/2
map/2
monitor/2
parse/1
reply_cast/2
sync/3
throw/1
token/1
type_check/1
type_check_params/3
validate/1
validate_schema/0

Function Details

execute/1

execute(AST::document()) -> #{atom() => json()}

execute/2

execute(Ctx::context(), AST::document()) -> #{atom() => json()}

format_errors/2

format_errors(Ctx, Errs) -> any()

insert_root/1

insert_root(Defn::schema_definition()) -> ok

insert_schema_definition/1

insert_schema_definition(Defn::schema_definition()) -> ok | {error, Reason}

insert_schema_definition/1 loads a schema definition into the Graph Schema

load_schema/2

load_schema(Mapping, Input) -> any()

map/2

map(F, X2) -> any()

monitor/2

monitor(Worker::pid(), X2::result()) -> result()

parse/1

parse(Input::binary() | string()) -> {ok, document()} | {error, {scanner_error | parser_error, term()}}

reply_cast/2

reply_cast(X1::token(), Data::term()) -> ok

sync/3

sync(X1, Pid, Msg) -> any()

throw/1

throw(Msg) -> any()

token/1

token(X1::#{defer_process := pid(), defer_request_id := reference()}) -> token()

type_check/1

type_check(AST::document()) -> {ok, #{atom() => term()}}

type_check_params/3

type_check_params(FunEnv::any(), OpName::any(), Vars::any()) -> param_context()

validate/1

validate(AST::document()) -> ok | {error, term()}

validate_schema/0

validate_schema() -> ok | {error, any()}


Generated by EDoc