View Source graphql (graphql v0.17.1)
Summary
Functions
insert_schema_definition/1 loads a schema definition into the Graph Schema
Types
-type ast() :: document().
-type defer_map() :: #{worker => pid(), timeout => non_neg_integer(), apply => [fun()]}.
-type document() :: #document{definitions :: [any()]}.
-type enum_type() :: #enum_type{id :: binary(), description :: binary(), resolve_module :: mod(), directives :: [graphql:directive()], values :: #{integer() => enum_value()}}.
-type enum_value() :: #enum_value{val :: binary(), description :: binary(), directives :: [graphql:directive()], deprecation :: undefined | binary()}.
-type mod() :: atom().
-type name() :: {name, pos_integer(), binary()} | binary().
-type param_context() :: json().
-type resolver() :: fun((ctx, term(), binary(), resolver_args()) -> term()).
-type scalar_type() :: #scalar_type{id :: binary(), description :: binary(), directives :: [graphql:directive()], resolve_module :: mod()}.
-type schema_arg() :: #schema_arg{ty :: schema_type(), default :: any(), description :: binary(), directives :: [graphql:directive()]}.
-type schema_base_type() :: scalar_type() | enum_type() | binary().
-type schema_field() :: #schema_field{ty :: schema_type(), description :: binary() | undefined, resolve :: undefined | resolver(), deprecation :: undefined | binary(), directives :: [graphql:directive()], args :: #{binary() => schema_arg()}}.
-type schema_type() :: {non_null, schema_base_type()} | {non_null, {list, schema_base_type()}} | {list, schema_base_type()} | schema_base_type().
Functions
-spec execute(endpoint_context(), context(), document()) -> #{atom() => json()}.
-spec get_endpoint(atom()) -> endpoint_context().
-spec insert_root(schema_definition()) -> ok.
-spec insert_root(endpoint_context(), schema_definition()) -> ok.
-spec insert_schema_definition(schema_definition()) -> ok | {error, Reason} when Reason :: term().
insert_schema_definition/1 loads a schema definition into the Graph Schema
-spec insert_schema_definition(endpoint_context(), schema_definition()) -> ok | {error, Reason} when Reason :: term().
-spec type_check(endpoint_context(), document()) -> {ok, #{atom() => term()}}.
-spec type_check_params(any(), any(), any()) -> param_context().
-spec type_check_params(endpoint_context(), any(), any(), any()) -> param_context().
-spec validate_schema() -> ok | {error, any()}.
-spec validate_schema(endpoint_context()) -> ok | {error, any()}.