VariableClassGenerator

Generates Kotlin data classes for operation variables.

Backend-dependent annotations:

Example output:

@Serializable
public data class GetMarketPlaceAppsVariables(
@SerialName("after") public val after: String? = null,
@SerialName("before") public val before: String? = null,
@SerialName("first") public val first: Int,
) : GraphQLVariables

Functions

Link copied to clipboard
fun generate(operation: GraphQLOperationInfo, packageName: String, scalarMappings: Map<String, String>, schemaIndex: SchemaIndex, backend: SerializationBackend = SerializationBackend.NONE): FileSpec?

Generates a variable class for a single operation that has variables. Returns null if the operation has no variables.