TypedGql.Schema.Type (TypedGql v0.13.0)

Copy Markdown View Source

A named type in a loaded schema: object, interface, union, enum, scalar or input object, with whichever shape its kind gives it.

Summary

Types

kind()

@type kind() ::
  :scalar
  | :object
  | :interface
  | :union
  | :enum
  | :input_object
  | :list
  | :non_null

t()

@type t() :: %TypedGql.Schema.Type{
  description: String.t() | nil,
  enum_values: [TypedGql.Schema.EnumValue.t()],
  fields: %{required(String.t()) => TypedGql.Schema.Field.t()},
  input_fields: %{required(String.t()) => TypedGql.Schema.InputValue.t()},
  interfaces: [String.t()],
  kind: kind(),
  name: String.t() | nil,
  of_type: TypedGql.Schema.TypeRef.t() | nil,
  possible_types: [String.t()]
}

Functions

get_field(type, name)

@spec get_field(t(), String.t()) :: {:ok, TypedGql.Schema.Field.t()} | :error