graphqexl v0.1.0-alpha-rc.19 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 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(str)

(since 0.1.0)
gql(gql() | json()) :: %Graphqexl.Schema{
  context: term(),
  enums: term(),
  interfaces: term(),
  mutations: term(),
  queries: term(),
  resolvers: term(),
  str: 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