Package-level declarations

Types

Link copied to clipboard
data class BLabel(val label: String?) : BTerm

A term that comes from @defer directives and that needs to be matched against label and current JSON path

Link copied to clipboard

A boolean expression

Link copied to clipboard
data class BPossibleTypes(val possibleTypes: Set<String>) : BTerm

A term that comes from a fragment type condition and that needs to be matched against __typename

Link copied to clipboard

A generic term in a BooleanExpression

Link copied to clipboard
data class BVariable(val name: String) : BTerm

A term that comes from @include/@skip or @defer directives and that needs to be matched against operation variables

Link copied to clipboard
@Serializable
sealed class IrAccessor
Link copied to clipboard
@Serializable
data class IrArgument(val definitionId: String, val definitionPropertyName: String, val value: IrValue?)
Link copied to clipboard
@Serializable
@SerialName(value = "boolean")
data class IrBooleanValue(val value: Boolean) : IrValue
Link copied to clipboard
@Serializable
enum IrCatchTo : Enum<IrCatchTo>
Link copied to clipboard
data class IrClassName(val packageName: String, val names: List<String>)
Link copied to clipboard
@Serializable
@SerialName(value = "enum")
data class IrEnumType(val name: String, val nullable: Boolean = false, val optional: Boolean = false, val catchTo: IrCatchTo = IrCatchTo.NoCatch, val maybeError: Boolean = false) : IrNamedType
Link copied to clipboard
@Serializable
@SerialName(value = "enum")
data class IrEnumValue(val value: String) : IrValue
Link copied to clipboard
@Serializable
@SerialName(value = "field")
data class IrField(val name: String, val alias: String?, val type: IrTypeRef, val condition: BooleanExpression<BVariable>, val arguments: List<IrArgument>, val selectionSetName: String?) : IrSelection
Link copied to clipboard
@Serializable
data class IrFieldInfo(val responseName: String, val type: IrType, val gqlType: GQLType?, val description: String?, val deprecationReason: String?, val optInFeature: String?)

Information about a field that is going to be turned into an IrProperty. This merges fields and replaces directives by things that are easier to use from codegen (description, deprecation, etc...)

Link copied to clipboard
@Serializable
@SerialName(value = "float")
data class IrFloatValue(val value: String) : IrValue
Link copied to clipboard
@Serializable
@SerialName(value = "fragment")
data class IrFragment(val typeCondition: String, val possibleTypes: List<String>, val condition: BooleanExpression<BVariable>, val selectionSetName: String?, val name: String?) : IrSelection
Link copied to clipboard
@Serializable
data class IrFragmentDefinition(val name: String, val description: String?, val filePath: String, val variables: List<IrVariable>, val typeCondition: String, val selectionSets: List<IrSelectionSet>, val interfaceModelGroup: IrModelGroup?, val dataProperty: IrProperty, val dataModelGroup: IrModelGroup, val source: String, val isTypeConditionAbstract: Boolean)
Link copied to clipboard
class IrGraphqlTargetArgument(val name: String, val targetName: String, val type: IrType) : IrTargetArgument
Link copied to clipboard
@Serializable
@SerialName(value = "input")
data class IrInputObjectType(val name: String, val nullable: Boolean = false, val optional: Boolean = false, val catchTo: IrCatchTo = IrCatchTo.NoCatch, val maybeError: Boolean = false) : IrNamedType
Link copied to clipboard
@Serializable
@SerialName(value = "int")
data class IrIntValue(val value: String) : IrValue
Link copied to clipboard
@Serializable
@SerialName(value = "list")
data class IrListType(val ofType: IrType, val nullable: Boolean = false, val optional: Boolean = false, val catchTo: IrCatchTo = IrCatchTo.NoCatch, val maybeError: Boolean = false) : IrType
Link copied to clipboard
@Serializable
@SerialName(value = "list")
data class IrListTypeRef(val ofType: IrTypeRef) : IrTypeRef
Link copied to clipboard
@Serializable
data class IrModel(val modelName: String, val id: String, val typeSet: TypeSet, val properties: List<IrProperty>, val possibleTypes: List<String>, val accessors: List<IrAccessor>, val implements: List<String>, val modelGroups: List<IrModelGroup>, val isInterface: Boolean, val isFallback: Boolean)

A class or interface representing a GraphQL object field

Link copied to clipboard
@Serializable
data class IrModelGroup(val baseModelId: String, val models: List<IrModel>)
Link copied to clipboard
@Serializable
@SerialName(value = "model")
data class IrModelType(val path: String, val nullable: Boolean = false, val optional: Boolean = false, val catchTo: IrCatchTo = IrCatchTo.NoCatch, val maybeError: Boolean = false) : IrNamedType
Link copied to clipboard
@Serializable
sealed interface IrNamedType : IrType
Link copied to clipboard
@Serializable
@SerialName(value = "named")
data class IrNamedTypeRef(val name: String) : IrTypeRef
Link copied to clipboard
@Serializable
@SerialName(value = "nonnull")
data class IrNonNullTypeRef(val ofType: IrTypeRef) : IrTypeRef
Link copied to clipboard
@Serializable
@SerialName(value = "null")
object IrNullValue : IrValue
Link copied to clipboard
@Serializable
@SerialName(value = "object")
data class IrObjectType(val name: String, val nullable: Boolean = false, val optional: Boolean = false, val catchTo: IrCatchTo = IrCatchTo.NoCatch, val maybeError: Boolean = false) : IrNamedType
Link copied to clipboard
@Serializable
@SerialName(value = "object")
data class IrObjectValue(val fields: List<IrObjectValue.Field>) : IrValue
Link copied to clipboard
@Serializable
data class IrOperation(val name: String, val operationType: IrOperationType, val typeCondition: String, val variables: List<IrVariable>, val description: String?, val selectionSets: List<IrSelectionSet>, val sourceWithFragments: String, val normalizedFilePath: String, val dataProperty: IrProperty, val dataModelGroup: IrModelGroup)
Link copied to clipboard
@Serializable
data class IrOperations(val operations: List<IrOperation>, val fragments: List<IrFragmentDefinition>, val usedCoordinates: UsedCoordinates, val flattenModels: Boolean, val decapitalizeFields: Boolean, val codegenModels: String, val fragmentDefinitions: List<@Serializable(with = GQLFragmentDefinitionSerializer::class) GQLFragmentDefinition>)

Intermediate representation (IR)

Link copied to clipboard
@Serializable
sealed interface IrOperationType
Link copied to clipboard
@Serializable
data class IrProperty(val info: IrFieldInfo, val override: Boolean, val condition: BooleanExpression<BTerm>, val requiresBuffering: Boolean)
Link copied to clipboard
@Serializable
@SerialName(value = "scalar")
data class IrScalarType(val name: String, val nullable: Boolean = false, val optional: Boolean = false, val catchTo: IrCatchTo = IrCatchTo.NoCatch, val maybeError: Boolean = false) : IrNamedType
Link copied to clipboard
interface IrSchema
Link copied to clipboard
@Serializable
sealed interface IrSelection
Link copied to clipboard
@Serializable
data class IrSelectionSet(val name: String, val isRoot: Boolean, val selections: List<IrSelection>)
Link copied to clipboard
@Serializable
@SerialName(value = "string")
data class IrStringValue(val value: String) : IrValue
Link copied to clipboard
sealed interface IrTargetArgument
Link copied to clipboard
class IrTargetField(val name: String, val targetName: String, val isFunction: Boolean, val type: IrType, val arguments: List<IrTargetArgument>)
Link copied to clipboard
class IrTargetObject(val name: String, val targetClassName: IrClassName, val isSingleton: Boolean, val hasNoArgsConstructor: Boolean, val operationType: String?, val fields: List<IrTargetField>)
Link copied to clipboard
@Serializable
sealed interface IrType

The IR representation of an input or output field

Link copied to clipboard
@Serializable
sealed interface IrTypeRef
Link copied to clipboard
@Serializable
sealed class IrValue
Link copied to clipboard
@Serializable
data class IrVariable(val name: String, val type: IrType, val defaultValue: IrValue?)

Functions

Link copied to clipboard
fun IrType.nullable(nullable: Boolean): IrType
Link copied to clipboard
fun IrType.optional(optional: Boolean): IrType