graphqexl v0.1.0-alpha-rc.23 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.

Parses a json map into a Graphqexl.Schema.t/0.

Check whether a field is defined on the given schema.

Registers the given component on the given schema.

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) :: Graphqexl.Schema.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()) :: %Graphqexl.Schema{
  context: term(),
  enums: term(),
  interfaces: term(),
  mutations: term(),
  queries: term(),
  resolvers: term(),
  subscriptions: term(),
  types: term(),
  unions: term()
}

Parses a json map 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 field is defined on the given schema.

Returns: boolean/0

Link to this function

register(schema, component)

(since 0.1.0)
register(GraphqexlSchema.t(), component()) :: Graphqexl.Schema.t()

Registers the given component on the given schema.

Returns Graphqexl.Schema.t/0