VariableClassGenerator
Generates Kotlin data classes for operation variables.
Backend-dependent annotations:
SerializationBackend.KOTLINX:
@Serializableon class,@SerialName(wireName)on every property.SerializationBackend.GSON:
@SerializedName(wireName)on every property.SerializationBackend.NONE: No serialization 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,
) : GraphQLVariablesContent copied to clipboard
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.