TypedGql.Language.Document (TypedGql v0.13.0)

Copy Markdown View Source

A parsed GraphQL document: the root of the tree, holding every operation, fragment and type definition the source declared.

Summary

Functions

The document's fragment definitions, keyed by name.

Types

t()

@type t() :: %TypedGql.Language.Document{
  definitions: [TypedGql.Language.definition_t()],
  loc: map()
}

Functions

fragments_by_name(document)

@spec fragments_by_name(t()) :: %{
  required(String.t()) => TypedGql.Language.Fragment.t()
}

The document's fragment definitions, keyed by name.

A repeated name keeps the last definition, matching the shadowing rule everywhere else: the latest definition wins.