IrType

@Serializable
interface IrType

The IR representation of an input or output field

Allowed

  • T

  • Nullable<T>

  • Option<T>

  • Option<Nullable<T>>

  • Result<T>

  • Result<Nullable<T>>

  • All List variations of the above

Disallowed

  • Nullable<Option<T>>

  • Nullable<Result<T>>

  • Nullable<Nullable<T>>

  • Option<Option<T>>

  • Option<Result<T>>

  • Result<Option<T>>

  • Result<Result<T>>

  • etc...

We need both Option and Nullable to distinguish ? vs Option in Kotlin (see this Arrow article). In java Option and Nullable might be represented using the same Optional depending on the settings.

Inheritors

Properties

Link copied to clipboard
abstract val catchTo: IrCatchTo

reading this type must catch exceptions during parsing

Link copied to clipboard
abstract val maybeError: Boolean

This type may be an error true if the type is nullable in the server schema. Used to generate error aware adapters

Link copied to clipboard
abstract val nullable: Boolean

This type is nullable in Kotlin

Link copied to clipboard
abstract val optional: Boolean

This type is optional in Kotlin

Functions

Link copied to clipboard
abstract fun copyWith(maybeError: Boolean = this.maybeError, nullable: Boolean = this.nullable, optional: Boolean = this.optional, catchTo: IrCatchTo = this.catchTo): IrType
Link copied to clipboard
fun IrType.nullable(nullable: Boolean): IrType
Link copied to clipboard
fun IrType.optional(optional: Boolean): IrType
Link copied to clipboard
abstract fun rawType(): IrNamedType