Fragment

Base interface for a fragment implementation. Fragments do not have variables per the GraphQL spec but they are inferred from arguments and used when reading the cache See https://github.com/graphql/graphql-spec/issues/204 for a proposal to add fragment arguments

Types

Link copied to clipboard
interface Data : Executable.Data

Marker interface for generated models of this fragment

Functions

Link copied to clipboard
abstract fun adapter(): Adapter<D>

The Adapter that maps the server response data to/from generated model class D.

Link copied to clipboard
fun <D : Executable.Data> Executable<D>.composeData(jsonWriter: JsonWriter, customScalarAdapters: CustomScalarAdapters, value: D)
Link copied to clipboard

Returns the Set of boolean variables that are false either explicitly or because there is a default value

Link copied to clipboard
fun <D : Executable.Data> Executable<D>.parseData(jsonReader: JsonReader, customScalarAdapters: CustomScalarAdapters = CustomScalarAdapters.Empty, falseVariables: Set<String>? = null, deferredFragmentIds: Set<DeferredFragmentIdentifier>? = null, errors: List<Error>? = null): D?
Link copied to clipboard
abstract fun rootField(): CompiledField

A list of CompiledSelection. Used when reading from the cache and/or normalizing a model. Use com.apollographql.apollo.cache.normalized.ApolloStore.readOperation for a higher level API

Link copied to clipboard
abstract fun serializeVariables(writer: JsonWriter, customScalarAdapters: CustomScalarAdapters, withDefaultValues: Boolean)

Serializes the variables of this operation to a json

Link copied to clipboard

Returns a map of the variables as they would be sent over the wire. Use this to construct your own HTTP requests

fun <D : Executable.Data> Executable<D>.variables(customScalarAdapters: CustomScalarAdapters, withDefaultValues: Boolean): Executable.Variables
Link copied to clipboard

Returns the variables as they would be sent over the wire. Use this to construct your own HTTP requests