GraphQLOperationRequest
data class GraphQLOperationRequest<TVariables : GraphQLVariables>(val query: String, val operationName: String, val variables: TVariables? = null, val extensions: GraphQLValue.ObjectValue? = null)(source)
Backend-neutral GraphQL operation request payload.
GraphQLOperationRequest is the transport contract for a single GraphQL request before any Retrofit or HTTP concerns are applied. It is the neutral counterpart of the serializer-coupled co.anitrend.retrofit.graphql.model.GraphQLRequest.
All properties are immutable vals; use copy or withPersistedQuery to derive a new request. variables is nullable because an operation may take no variables.
Usage
val request = GraphQLOperationRequest<EmptyGraphQLVariables>(
query = "query GetCurrentUser { viewer { login } }",
operationName = "GetCurrentUser",
)Content copied to clipboard
Type Parameters
TVariables
The type of variables, or co.anitrend.retrofit.graphql.model.EmptyGraphQLVariables for operations without variables.
See also
Constructors
Link copied to clipboard
constructor(query: String, operationName: String, variables: TVariables? = null, extensions: GraphQLValue.ObjectValue? = null)