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
Link copied to clipboard

ApolloCompilerPlugin allows to customize the behaviour of the Apollo Compiler.

Link copied to clipboard

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
@Serializable
class CodegenMetadata(val targetLanguage: TargetLanguage, val entries: List<ResolverEntry>)

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, val scalarMapping: Map<String, ScalarInfo>, val generateDataBuilders: Boolean)

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 scalarMapping: Map<String, ScalarInfo>, val generateDataBuilders: Boolean?)
Link copied to clipboard
Link copied to clipboard

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

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
interface LayoutFactory
Link copied to clipboard

A class that generates OperationOutput to compute the operationIds. OperationOutputGenerator works with a collection of OperationDescriptor for implementation that need to batch compute the operationIds. For an example to send all the operation at once to a backend for whitelisting.

Link copied to clipboard
Link copied to clipboard

A PackageNameGenerator computes the package name for a given file. Files can be either

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
@Serializable
class ScalarInfo(val targetName: String, val adapterInitializer: AdapterInitializer = RuntimeAdapterInitializer, val userDefined: Boolean = true)
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
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 buildCodegenSchemaOptions(scalarMapping: Map<String, ScalarInfo> = emptyMap(), generateDataBuilders: Boolean? = null): CodegenSchemaOptions
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
@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