Package com.apollographql.apollo3.api.json

Types

BufferedSinkJsonWriter
Link copied to clipboard
common
class BufferedSinkJsonWriter @JvmOverloads() constructor(sink: BufferedSink, indent: String?) : JsonWriter
A JsonWriter that writes json to an okio BufferedSinkThe base implementation was taken from Moshi and ported to Kotlin multiplatform with some tweaks to make it better suited for GraphQL (see JsonWriter and path).
BufferedSourceJsonReader
Link copied to clipboard
common
class BufferedSourceJsonReader(source: BufferedSource) : JsonReader
A JsonWriter that reads json from an okio BufferedSourceThe base implementation was taken from Moshi and ported to Kotlin multiplatform with some tweaks to make it better suited for GraphQL (see JsonReader).
JsonNumber
Link copied to clipboard
common
class JsonNumber(value: String)
A simple wrapper class that can be put in Map to indicate an arbitrary precision json number
JsonReader
Link copied to clipboard
common
interface JsonReader : Closeable
Reads a JSON RFC 7159 encoded value as a stream of tokens.
JsonWriter
Link copied to clipboard
common
interface JsonWriter : Closeable
Writes a JSON RFC 7159 encoded value to a stream, one token at a time.
MapJsonReader
Link copied to clipboard
common
class MapJsonReader(root: Map<String, Any?>) : JsonReader
A JsonReader that reads data from a regular Map<String, Any?
MapJsonWriter
Link copied to clipboard
common
class MapJsonWriter : JsonWriter
A JsonWriter that writes data to a Map<String, Any?

Functions

jsonReader
Link copied to clipboard
common
fun Map<String, Any?>.jsonReader(): JsonReader
fun BufferedSource.jsonReader(): JsonReader
readAny
Link copied to clipboard
common
fun JsonReader.readAny(): Any?
Reads the reader and maps numbers to the closest representation possible in that order:
  • Int

  • Long

  • Double

  • JsonNumber