Field

data class Field(val name: String, val parent: QueryElement?) : QueryElement

Represents a field to be queried

Constructors

Link copied to clipboard
constructor(name: String, parent: QueryElement?)

Types

Link copied to clipboard

Types that arguments can be

Properties

Link copied to clipboard

Alias for the field name

Link copied to clipboard

Name of the field to be queried

Link copied to clipboard
open override val parent: QueryElement?

Functions

Link copied to clipboard
fun addArg(name: String, variable: Variable)

Adds a variable as an argument to the field. This will automatically register the variable for use in the query or mutation.

fun addArg(name: String, value: Long)
fun addArg(name: String, typeName: String)
fun addArg(name: String, typeName: Long, type: Field.ArgumentType)
fun addArg(name: String, typeName: String, type: Field.ArgumentType)

Adds an argument to the field

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
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 fragment(type: String, init: Fragment.() -> Unit): Fragment

Create and register an inline fragment for use in the field

Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
fun include(variable: Variable)

fun include(bool: Boolean)

Adds an include directive to the field

Link copied to clipboard
fun skip(variable: Variable)

fun skip(bool: Boolean)

Adds an skip directive to the field

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

Generates the GraphQL string for the field

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 fragment into the field