sendQuery

inline suspend fun <T, E : GQLError> sendQuery(url: String, query: Query, variables: JsonObject? = null, operationName: String = "", headers: List<HttpHeader> = listOf()): Response<T, E>

Sends a query to a specified HTTP endpoint as a POST request.

Return

Returns a Response serialized from the json received.

Parameters

T

Type to serialize the data into.

E

Type to serialize any errors into.

url

URL to send the request to.

query

Query to send.

variables

Values of variables used in query to send (Optional).

operationName

Name of the operation performed (Optional).

headers

Headers to send along with the HTTP request as a list of HttpHeader.