Query

data class Query(val name: String) : QueryElement, Operation

Represents a GraphQL query Created using query

Parameters

name

Name for the query (Optional).

See also

Constructors

Link copied to clipboard
constructor(name: String)

Properties

Link copied to clipboard
Link copied to clipboard
open val parent: QueryElement?

Functions

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(name: String, type: String, init: Fragment.() -> Unit): Fragment

Create and register a fragment for use in the query

Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
fun registerFragment(fragment: Fragment)

Register an existing Fragment into the query

Link copied to clipboard

Add schema info to a query. Equivalent to __schema.

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

Converts the query object into a string containing a GraphQL query.

Link copied to clipboard

Puts type information into the query. Equivalent to adding a __type.

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 variable(variable: Variable)

fun variable(name: String, type: String)

Create a variable for use in the GraphQL query