GraphQLJson

interface GraphQLJson(source)

Pluggable serialization abstraction for GraphQL request and response bodies.

Implementations exist for Gson, kotlinx.serialization, and any other JSON serialization framework that consumers prefer.

Functions

Link copied to clipboard
abstract fun <T : Any> decode(json: String, type: Type): T

Decode a JSON string into an instance of T.

Link copied to clipboard
abstract fun <T : Any> encode(value: T, type: Type? = null): String

Encode value into a JSON string.