commonMain.com.apollographql.apollo.api.internal.ResponseWriter.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of apollo-api Show documentation
Show all versions of apollo-api Show documentation
Apollo GraphQL API classes
package com.apollographql.apollo.api.internal
import com.apollographql.apollo.api.ResponseField
import com.apollographql.apollo.api.ScalarType
interface ResponseWriter {
fun writeString(field: ResponseField, value: String?)
fun writeInt(field: ResponseField, value: Int?)
fun writeLong(field: ResponseField, value: Long?)
fun writeDouble(field: ResponseField, value: Double?)
fun writeBoolean(field: ResponseField, value: Boolean?)
fun writeCustom(field: ResponseField.CustomTypeField, value: Any?)
fun writeObject(field: ResponseField, marshaller: ResponseFieldMarshaller?)
fun writeFragment(marshaller: ResponseFieldMarshaller?)
fun writeList(field: ResponseField, values: List?, listWriter: ListWriter)
fun writeList(field: ResponseField, values: List?, block: (items: List?, listItemWriter: ListItemWriter) -> Unit) {
writeList(field, values, object : ListWriter {
override fun write(items: List?, listItemWriter: ListItemWriter) {
block(items, listItemWriter)
}
})
}
interface ListWriter {
fun write(items: List?, listItemWriter: ListItemWriter)
}
interface ListItemWriter {
fun writeString(value: String?)
fun writeInt(value: Int?)
fun writeLong(value: Long?)
fun writeDouble(value: Double?)
fun writeBoolean(value: Boolean?)
fun writeCustom(scalarType: ScalarType, value: Any?)
fun writeObject(marshaller: ResponseFieldMarshaller?)
fun writeList(items: List?, listWriter: ListWriter)
fun writeList(items: List?, block: (items: List?, listItemWriter: ListItemWriter) -> Unit) {
writeList(items, object : ListWriter {
override fun write(items: List?, listItemWriter: ListItemWriter) {
block(items, listItemWriter)
}
})
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy