com.walmartlabs.lacinia.selection
added in 0.38.0
Protocols for selection-related objects accessible from the selection function, and as well as the schema type objects navigable to from the selection, or via select-type.
Arguments
protocol
Implemented by Directive.
members
arguments
(arguments element)
Returns a map of keyword name to argument value. May return nil if no arguments.
The value may reflect evaluated query variables or argument defaults.
Directive
protocol
Implements Arguments.
members
directive-type
(directive-type d)
Returns the type of directive as a keyword.
Directives
protocol
An element that may contain directives.
members
directives
(directives element)
Returns a map of directives for this element; keys are keywords identifying the directive, values are a seq of Directive of that type (directives are inherently repeatable).
May return nil.
FieldDef
protocol
A field within a TypeDef. Implements Type, Directives, ArgumentDefs, and QualifiedName.
members
field-name
(field-name fs)
Returns the name of the field (as an unqualified keyword).
Fields
protocol
Implemented by the :object and :interface TypeDef kinds to expose the type’s fields.
members
FieldSelection
protocol
A SelectionSet that extracts a value from a field and records it into the result as a name or alias; for non-scalar types, may have sub-selections.
Also implements Arguments, and Directives.
Directives here are the directives on the selection (the executable directives); access the underlying field to get the type system directives.
members
Kind
protocol
A Kind is a root type with qualifiers (list, or non-null). A root kind identifies a TypeDef. A Kind can be converted to a GraphQL type string.
members
as-type-string
(as-type-string kind)
Returns the kind as an GraphQL language string, e.g. [String!]
.
kind-type
(kind-type kind)
One of :non-null, :list, or :root.
QualifiedName
protocol
members
qualified-name
(qualified-name named)
Returns a keyword whose namespace is the containing element; e.g., :User/id
for the id
field of the User
type.
SelectionSet
protocol
A selection that may contain sub-selections.
members
selection-kind
(selection-kind selection)
The type of selection: either :field, :inline-fragment or :named-fragment.
For :field, the FieldSelection protocol will also be implemented.
selections
(selections selection)
Returns a seq of sub-selections (also SelectionSets) of this selection.
May be nil for a field that selects a scalar.
Type
protocol
For a typed element, such as a FieldDef or an ArgumentDef, details the schema type.
members
TypeDef
protocol
A type defined in a GraphQL schema. Implements the Directives protocol as well.
members
type-category
(type-category type)
Returns the category of the type, one of: :object
, :union
, :interface
, :scalar
, or :enum
.
type-name
(type-name type)
Returns the name of the type, as a keyword.