graphqexl v0.1.0-alpha-rc.24 Graphqexl.Schema

Structured representation of a GraphQL schema, either built dynamically or parsed from a JSON document or GQL string.

Link to this section Summary

Functions

Builds an executable schema containing the schema definition as well as resolver map and context factory.

Link to this section Types

Link to this type

gql()

gql() :: String.t()
Link to this type

json()

json() :: Map.t()
Link to this type

t()

t() :: %Graphqexl.Schema{
  context: (Graphqexl.Schema.Query.t(), Map.t() -> Map.t()),
  enums: %{required(atom()) => Graphqexl.Schema.TEnum.t()},
  interfaces: %{required(atom()) => Graphqexl.Schema.Interface.t()},
  mutations: %{required(atom()) => Graphqexl.Schema.Mutation.t()},
  queries: %{required(atom()) => Graphqexl.Schema.Query.t()},
  resolvers: %{required(atom()) => (Map.t(), Map.t(), Map.t() -> Map.t())},
  subscriptions: %{required(atom()) => Graphqexl.Schema.Subscription.t()},
  types: %{required(atom()) => Graphqexl.Schema.Type.t()},
  unions: %{required(atom()) => Graphqexl.Schema.Union.t()}
}

Link to this section Functions

Link to this function

executable(gql_str, resolvers, context \\ nil)

(since 0.1.0)
executable(gql(), Map.t(), Map.t() | nil) :: t()

Builds an executable schema containing the schema definition as well as resolver map and context factory.

Returns: Graphqexl.Schema.t/0

Link to this function

gql(gql_str)

(since 0.1.0)
gql(gql() | json()) :: t()

Parses a Graphqexl.Schema.gql/0 string into a Graphqexl.Schema.t/0.

Returns: Graphqexl.Schema.t/0

Link to this function

has_field?(schema, field)

(since 0.1.0)
has_field?(Graphqexl.Schema.t(), atom()) :: boolean()

Check whether a Graphqexl.Schema.Field.t/0 is defined on the given Graphqexl.Schema.t/0.

Returns: boolean/0

Link to this function

register(schema, component)

(since 0.1.0)
register(t(), component()) :: t()

Registers the given Graphqexl.Schema.component/0 on the given Graphqexl.Schema.t/0.

Returns Graphqexl.Schema.t/0