commonMain.com.apollographql.apollo3.api.Executable.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of apollo-api-jvm Show documentation
Show all versions of apollo-api-jvm Show documentation
Apollo GraphQL API classes
package com.apollographql.apollo3.api
import com.apollographql.apollo3.api.Executable.Variables
import com.apollographql.apollo3.api.json.ApolloJsonElement
import com.apollographql.apollo3.api.json.JsonWriter
import okio.IOException
/**
* Base interface for [Operation] and [Fragment] that have a [Adapter] and [Variables].
*
* Fragments cannot be executed against a server but can be executed against the cache.
*/
interface Executable {
/**
* The [Adapter] that maps the server response data to/from generated model class [D].
*
* This is the low-level API generated by the compiler. Use [parseJsonResponse] and [composeJsonResponse] extension functions for a higher level API
*/
fun adapter(): Adapter
/**
* Serializes the variables of this operation to a json
*/
@Throws(IOException::class)
fun serializeVariables(writer: JsonWriter, customScalarAdapters: CustomScalarAdapters, withDefaultValues: Boolean)
/**
* A list of [CompiledSelection]. Used when reading from the cache and/or normalizing a model.
* Use [com.apollographql.apollo3.cache.normalized.ApolloStore.readOperation] for a higher level API
*/
fun rootField(): CompiledField
/**
* A flag to disable error checking for the whole operation.
* Used for backward compatibility.
*/
val ignoreErrors: Boolean
/**
* Marker interface for generated models
*/
interface Data
/**
* A helper class to hold variables
*
* [valueMap] contains all the variables as a Json-like map. Custom scalars are
* serialized to their json representation (String/Map most of the time).
* Input objects are serialized to Map
*/
class Variables(val valueMap: VariablesJson)
}
/**
* The variables as a Json representation. If some
*/
typealias VariablesJson = Map
© 2015 - 2025 Weber Informatics LLC | Privacy Policy