SelectionSet

SelectionSet describes a type-safe interface to querying and transforming a GraphQL selection set.

Inheritors

Types

Link copied to clipboard
object Companion
Link copied to clipboard

A marker object that defines a SelectionSet for a type that does not support selections. NoSelections can be used in places where a SelectionSet is required but cannot be defined.

Properties

Link copied to clipboard
abstract val type: Type<T>

the type condition of this SelectionSet

Functions

Link copied to clipboard
abstract fun <U : T> contains(field: Field<U>): Boolean

Returns true if this SelectionSet includes the provided Field.

Link copied to clipboard
abstract fun isEmpty(): Boolean

Returns true if this SelectionSet contains no fields for any valid type projection.

Link copied to clipboard
abstract fun <U : T> requestsType(type: Type<U>): Boolean

Returns true if the provided type is requested in this SelectionSet.

Link copied to clipboard

Returns the schema field coordinates selected directly at this selection set's current level.

Link copied to clipboard

Return a SelectionSet describing the selections at the provided field. If the current SelectionSet does not include the provided field, then an empty SelectionSet will be returned.

abstract fun <U : T> selectionSetFor(type: Type<U>): SelectionSet<U>

Return a SelectionSet that is a projection of the selections on the provided type. The returned SelectionSet may include fields that are selected on a parent interface or union -- if you need to know if a projected SelectionSet contains non-inherited selections for a type, see requestsType

Link copied to clipboard

Renders this selection set as a GraphQL fragment.