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): GraphQLRequest<GetMarketPlaceAppsVariables> =
GraphQLRequest(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 = ...
}

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.