Package-level declarations

Types

Link copied to clipboard
@Serializable
sealed interface AdapterInitializer

Controls how scalar adapters are used in the generated code.

Link copied to clipboard
class After(val id: String) : Order
Link copied to clipboard
Link copied to clipboard

ApolloCompilerPlugin allows to customize the behavior of the Apollo Compiler.

Link copied to clipboard
class ApolloCompilerPluginEnvironment(    val arguments: Map<String, ApolloCompilerPluginValue?>,     val logger: ApolloCompilerPluginLogger,     val outputDirectory: File?)

ApolloCompilerPluginEnvironment contains the environment where the Apollo compiler is run.

Link copied to clipboard

ApolloCompilerPluginLogger allows logging from the context of the Apollo compiler.

Link copied to clipboard

An argument value for the plugin.

Link copied to clipboard
Link copied to clipboard
class Before(val id: String) : Order
Link copied to clipboard
fun interface CodeGenerator

A code generator that may write code in ApolloCompilerPluginEnvironment.outputDirectory

Link copied to clipboard
@Serializable
class CodegenMetadata(    val version: String,     val targetLanguage: TargetLanguage,     val entries: List<ResolverEntry>,     val inlineProperties: Map<String, String?>,     val scalarTargets: Map<String, String>,     val scalarAdapters: Map<String, String>,     val scalarIsUserDefined: Map<String, Boolean>)

CodegenMetadata contains information about what target classes were generated for each GraphQL types so that downstream modules can reuse them.

Link copied to clipboard
@Serializable
class CodegenOptions(    val targetLanguage: TargetLanguage?,     val packageName: String?,     val rootPackageName: String?,     val decapitalizeFields: Boolean?,     val useSemanticNaming: Boolean?,     val generateMethods: List<GeneratedMethod>?,     val operationManifestFormat: String?,     val generateSchema: Boolean?,     val generatedSchemaName: String?,     val sealedClassesForEnumsMatching: List<String>?,     val generateAsInternal: Boolean?,     val addUnknownForEnums: Boolean?,     val addDefaultArgumentForInputObjects: Boolean?,     val generateFilterNotNull: Boolean?,     val generateInputBuilders: Boolean?,     val addJvmOverloads: Boolean?,     val requiresOptInAnnotation: String?,     val jsExport: Boolean?,     val generateModelBuilders: Boolean?,     val classesForEnumsMatching: List<String>?,     val generatePrimitiveTypes: Boolean?,     val nullableFieldStyle: JavaNullable?,     val generateFragmentImplementations: Boolean?,     val generateQueryDocument: Boolean?) : SchemaCodegenOptions, OperationsCodegenOptions
Link copied to clipboard
@Serializable
class CodegenSchema(val schema: Schema, val normalizedPath: String)

A Schema linked with other options that are bound to this schema and need to be the same in all modules using this schema

Link copied to clipboard
@Serializable
class CodegenSchemaOptions(    val scalarTypeMapping: Map<String, String>,     val scalarAdapterMapping: Map<String, String>,     val generateDataBuilders: Boolean)
Link copied to clipboard
Link copied to clipboard

EntryPoints contains code called using reflection from the Gradle plugin. This is so that the classloader can be isolated, and we can use our preferred version of Kotlin and other dependencies without risking conflicts.

Link copied to clipboard
@Serializable
@SerialName(value = "expression")
class ExpressionAdapterInitializer(val expression: String) : AdapterInitializer

The adapter expression will be used as-is (can be an object, a public val, a class instantiation).

Link copied to clipboard
Link copied to clipboard
class InputFile(val file: File, val normalizedPath: String)

An input file together with its normalizedPath. normalizedPath is used to compute the package name in some cases

Link copied to clipboard
@Serializable
class IrOptions(    val fieldsOnDisjointTypesMustMerge: Boolean?,     val decapitalizeFields: Boolean?,     val flattenModels: Boolean?,     val warnOnDeprecatedUsages: Boolean?,     val failOnWarnings: Boolean?,     val addTypename: String?,     val generateOptionalOperationVariables: Boolean?,     val alwaysGenerateTypesMatching: Set<String>?,     val codegenModels: String?)
Link copied to clipboard
interface JavaCodegenOpt
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun interface LayoutFactory
Link copied to clipboard
fun interface OperationIdsGenerator
Link copied to clipboard
Link copied to clipboard
fun interface OperationsTransform

A OperationsTransform transforms operations and fragments at build time. OperationsTransform can add or remove fields automatically, for an example.

Link copied to clipboard
sealed interface Order
Link copied to clipboard
@Serializable
@SerialName(value = "runtime")
object RuntimeAdapterInitializer : AdapterInitializer

The adapter instance will be looked up in the com.apollographql.apollo.api.CustomScalarAdapters provided at runtime.

Link copied to clipboard
Link copied to clipboard
fun interface SchemaTransform
Link copied to clipboard
Link copied to clipboard
fun interface Transform<T>

Transforms a type

Link copied to clipboard
@Serializable
class UsedCoordinates

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
fun buildCodegenOptions(    targetLanguage: TargetLanguage? = null,     decapitalizeFields: Boolean? = null,     useSemanticNaming: Boolean? = null,     generateMethods: List<GeneratedMethod>? = null,     operationManifestFormat: String? = null,     generateSchema: Boolean? = null,     generatedSchemaName: String? = null,     sealedClassesForEnumsMatching: List<String>? = null,     generateAsInternal: Boolean? = null,     addUnknownForEnums: Boolean? = null,     addDefaultArgumentForInputObjects: Boolean? = null,     generateFilterNotNull: Boolean? = null,     generateInputBuilders: Boolean? = null,     addJvmOverloads: Boolean? = null,     requiresOptInAnnotation: String? = null,     jsExport: Boolean? = null,     generateModelBuilders: Boolean? = null,     classesForEnumsMatching: List<String>? = null,     generatePrimitiveTypes: Boolean? = null,     nullableFieldStyle: JavaNullable? = null,     generateFragmentImplementations: Boolean? = null,     generateQueryDocument: Boolean? = null,     packageName: String? = null,     rootPackageName: String? = null): CodegenOptions
Link copied to clipboard
fun buildIrOptions(    fieldsOnDisjointTypesMustMerge: Boolean? = null,     decapitalizeFields: Boolean? = null,     flattenModels: Boolean? = null,     warnOnDeprecatedUsages: Boolean? = null,     failOnWarnings: Boolean? = null,     addTypename: String? = null,     generateOptionalOperationVariables: Boolean? = null,     alwaysGenerateTypesMatching: Set<String>? = null,     codegenModels: String? = null): IrOptions
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
@JvmName(name = "readCodegenMetadata")
fun File.toCodegenMetadata(): CodegenMetadata
Link copied to clipboard
@JvmName(name = "readCodegenOptions")
fun File.toCodegenOptions(): CodegenOptions
Link copied to clipboard
@JvmName(name = "readCodegenSchema")
fun File.toCodegenSchema(): CodegenSchema

Reading compiler outputs

Link copied to clipboard
@JvmName(name = "readCodegenSchemaOptions")
fun File.toCodegenSchemaOptions(): CodegenSchemaOptions

Reading options

Link copied to clipboard
Link copied to clipboard
@JvmName(name = "readIrOperations")
fun File.toIrOperations(): IrOperations
Link copied to clipboard
@JvmName(name = "readIrOptions")
fun File.toIrOptions(): IrOptions
Link copied to clipboard
@JvmName(name = "readIrSchema")
fun File.toIrSchema(): IrSchema
Link copied to clipboard
@JvmName(name = "readOperationOutput")
fun File.toOperationOutput(): OperationOutput
Link copied to clipboard
@JvmName(name = "readPersistedQueryManifest")
fun File.toPersistedQueryManifest(): PersistedQueryManifest
Link copied to clipboard
Link copied to clipboard
@JvmName(name = "writeCodegenMetadata")
fun CodegenMetadata.writeTo(file: File)
@JvmName(name = "writeCodegenOptions")
fun CodegenOptions.writeTo(file: File)
@JvmName(name = "writeIrOptions")
fun IrOptions.writeTo(file: File)
@JvmName(name = "writeIrOperations")
fun IrOperations.writeTo(file: File)
@JvmName(name = "writeIrSchema")
fun IrSchema.writeTo(file: File)
@JvmName(name = "writePersistedQueryManifest")
fun PersistedQueryManifest.writeTo(file: File)
@JvmName(name = "writeOperationOutput")
fun OperationOutput.writeTo(file: File)

@JvmName(name = "writeCodegenSchema")
fun CodegenSchema.writeTo(file: File)

Writing compiler outputs

@JvmName(name = "writeCodegenSchemaOptions")
fun CodegenSchemaOptions.writeTo(file: File)

Writing options to files need to be public to start