Module graphql_schema

Behaviours: gen_server.

Data Types

directive_location()

directive_location() = 'QUERY' | 'MUTATION' | 'SUBSCRIPTION' | 'FIELD' | 'FRAGMENT_DEFINITION' | 'FRAGMENT_SPREAD' | 'INLINE_FRAGMENT' | 'SCHEMA' | 'SCALAR' | 'OBJECT' | 'FIELD_DEFINITION' | 'ARGUMENT_DEFINITION' | 'INTERFACE' | 'UNION' | 'ENUM' | 'ENUM_VALUE' | 'INPUT_OBJECT' | 'INPUT_FIELD_DEFINITION'

directive_type()

directive_type() = #directive_type{id = binary(), description = undefined | binary(), locations = [directive_location()], args = #{binary() => schema_arg()}}

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()}

input_object_type()

input_object_type() = #input_object_type{id = binary(), description = binary(), directives = [graphql:directive()], fields = #{binary() => schema_arg()}}

interface_type()

interface_type() = #interface_type{id = binary(), description = binary(), resolve_type = mod() | fun((any()) -> {ok, atom()} | {error, term()}), directives = [graphql:directive()], fields = #{binary() => schema_field()}}

mod()

mod() = atom()

object_type()

object_type() = #object_type{id = binary(), description = binary(), directives = [graphql:directive()], resolve_module = mod(), fields = #{binary() => schema_field()}, interfaces = [binary()]}

operation_type()

operation_type() = {query, pos_integer()} | {mutation, pos_integer()} | {subscription, pos_integer()}

resolver()

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

resolver_args()

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

root_schema()

root_schema() = #root_schema{id = atom(), query = undefined | binary(), mutation = undefined | binary(), subscription = undefined | binary(), directives = [graphql:directive()], interfaces = [binary()]}

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_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_object()

schema_object() = object_type() | interface_type() | scalar_type() | input_object_type() | union_type() | enum_type() | directive_type() | root_schema()

schema_type()

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

union_type()

union_type() = #union_type{id = binary(), description = binary(), resolve_type = mod() | fun((any()) -> {ok, atom()} | {error, term()}), directives = [graphql:directive()], types = [binary() | {name, non_neg_integer(), binary()}]}

Function Index

all/0
code_change/3
get/1
handle_call/3
handle_cast/2
handle_info/2
id/1
init/1
insert/1
insert/2
load/1
load_schema/1
lookup/1
lookup_interface_implementors/1
reset/0
resolve_root_type/2
start_link/0
terminate/2
validate_enum/2

Function Details

all/0

all() -> [any()]

code_change/3

code_change(OldVsn::term(), S, Aux::term()) -> {ok, S}

get/1

get(ID::binary() | 'ROOT') -> schema_object()

handle_call/3

handle_call(M, From::any(), S) -> {reply, term(), S}

handle_cast/2

handle_cast(Msg::any(), S) -> {noreply, S}

handle_info/2

handle_info(Msg::term(), S) -> {noreply, S}

id/1

id(Root_schema) -> any()

init/1

init(X1::[]) -> {ok, #state{}}

insert/1

insert(S::any()) -> ok

insert/2

insert(S::any(), X2::any()) -> ok | {error, Reason::term()}

load/1

load(S::any()) -> ok | {error, Reason}

load_schema/1

load_schema(Root_schema::#root_schema{id = atom(), query = undefined | binary(), mutation = undefined | binary(), subscription = undefined | binary(), directives = [graphql:directive()], interfaces = [binary()]}) -> ok

lookup/1

lookup(ID::binary() | 'ROOT') -> schema_object() | not_found

lookup_interface_implementors/1

lookup_interface_implementors(IFaceID::binary()) -> [binary()]

reset/0

reset() -> ok

resolve_root_type/2

resolve_root_type(X1::undefined | operation_type(), Root_schema::root_schema()) -> undefined | binary()

start_link/0

start_link() -> any()

terminate/2

terminate(X1::any(), X2::any()) -> any()

validate_enum/2

validate_enum(EnumID::binary(), EnumValue::binary()) -> ok | not_found | {other_enums, [#enum_type{id = binary(), description = binary(), resolve_module = mod(), directives = [graphql:directive()], values = #{integer() => enum_value()}}]}


Generated by EDoc