GsonGraphQLJson

class GsonGraphQLJson(gson: Gson = Gson()) : GraphQLJson(source)

Deprecated

Legacy GraphQLJson implementation of the GraphConverter flow. Use GsonGraphQLTransportCodec with the backend-neutral GraphQLConverterFactory instead.

Gson-backed implementation of GraphQLJson.

Legacy: lives in :compat for the deprecated co.anitrend.retrofit.graphql.converter.GraphConverter flow. New code should use co.anitrend.retrofit.graphql.serialization.gson.GsonGraphQLTransportCodec from :serialization-gson with the backend-neutral co.anitrend.retrofit.graphql.converter.GraphQLConverterFactory.

Parameters

gson

A configured Gson instance. Defaults to a plain Gson.

Constructors

Link copied to clipboard
constructor(gson: Gson = Gson())

Functions

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

Decode a JSON string into an instance of T.

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

Encode value into a JSON string.