OperationRequestGenerator

Generates per-operation helper objects.

For operations with variables, generates:

public object GetMarketPlaceApps : GraphQLOperation<GetMarketPlaceAppsVariables> {
override val name: String = GraphQLOperations.Query.GetMarketPlaceApps
override val document: String = GraphQLDocuments.GetMarketPlaceApps
override val sha256Hash: String = GraphQLHashes.GetMarketPlaceApps

public fun request(after: String? = null, before: String? = null, first: Int): GraphQLOperationRequest<GetMarketPlaceAppsVariables> =
GraphQLOperationRequest(query = document, operationName = name, variables = GetMarketPlaceAppsVariables(...))
}

For operations without variables:

public object GetCurrentUser : GraphQLNoVarOperation {
override val name: String = ...
override val document: String = ...
override val sha256Hash: String = ...
}

Request helpers use the backend-neutral co.anitrend.retrofit.graphql.model.request.GraphQLOperationRequest contract, not the legacy serializer-coupled co.anitrend.retrofit.graphql.model.GraphQLRequest. Operation name, document, hash, and registry semantics are unchanged.

Functions

Link copied to clipboard
fun generate(operation: GraphQLOperationInfo, packageName: String, scalarMappings: Map<String, String>, schemaIndex: SchemaIndex): FileSpec

Generates a request helper object for a single operation.