Fragment

data class Fragment(val name: String, type: String, val inline: Boolean) : QueryElement

Represents a fragment

Create fragments using fragment, Field.fragment or Query.fragment

See also

Constructors

Link copied to clipboard
constructor(name: String, type: String, inline: Boolean)

Properties

Link copied to clipboard
Link copied to clipboard

Name of the fragment

Link copied to clipboard
open val parent: QueryElement?

Functions

Link copied to clipboard
fun field(name: String, init: Field.() -> Unit = {}): Field

Creates and register a Field as a child of the current QueryElement

Link copied to clipboard
fun registerFragment(fragment: Fragment)

Register a nested Fragment into the fragment

Link copied to clipboard
open override fun toString(): String

Generates the GraphQL string for the fragment

Link copied to clipboard
fun typename()

Gets the name of the current type of the current QueryElement. Equivalent to __typename.

Link copied to clipboard
fun useFragment(fragment: Fragment)

Inserts a nested fragment into the fragment