query
abstract suspend fun query(selections: String, variables: Map<String, Any?> = emptyMap()): Q(source)
Loads the provided selections on the root Query type, and returns the response typed as Q. This is a convenience method that combines selectionsFor and query.
Example usage:
val result = ctx.query("{ user { id name } }")Content copied to clipboard
Return
The query result typed as Q
Parameters
selections
The selections to load on the root Query type
variables
Optional variables to use in the selections