ectograph v0.2.0 Ectograph.Definitions
Summary
Functions
Add an association to a definition
Build a field (a.k.a. definition)
Extend the arguments of a field
Extend the fields of the type of a field
Pick specific fields from a type definition. When the second argument is nil, it returns an empty map
Functions
Add an association to a definition.
e.g.
type_def = build(Quote, :all)
type_def = add_association(type_def, Author, :author) # default is ':single'
type_def = add_association(type_def, Author, :authors, :multiple)
Extend the arguments of a field.
Given a field (a.k.a. definition)
of the form %{ type: %{ fields: %{} }, args: %{} },
it will merge the args map with
the map given as the second argument to this function.
Extend the fields of the type of a field.
Given a field (a.k.a. definition) or a GraphQL.Type.List,
it will merge the type.fields map with
the map given as the second argument to this function.