GraphQLRequestConverter

class GraphQLRequestConverter(codec: GraphQLTransportCodec, type: Type) : Converter<Any, RequestBody> (source)

Backend-neutral GraphQL request body converter.

GraphQLRequestConverter is the neutral counterpart of the legacy GraphRequestConverter. It accepts only GraphQLOperationRequest bodies and delegates serialization entirely to a GraphQLTransportCodec; it never references a JSON backend, a document registry, or asset discovery.

Type forwarding

The complete Java Type of the body parameter as declared by the Retrofit method (for example GraphQLOperationRequest<GetUserVariables>) is forwarded to GraphQLTransportCodec.encodeRequest so the codec can resolve the typed variables serializer without reflection on the runtime class.

Failure behavior

Parameters

codec

The explicit GraphQLTransportCodec used to serialize bodies.

type

The complete Java reflection Type of the request body parameter, including generic arguments, as provided by Retrofit.

See also

GraphQLConverterFactory

Constructors

Link copied to clipboard
constructor(codec: GraphQLTransportCodec, type: Type)

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
open override fun convert(value: Any): RequestBody

Converts a GraphQLOperationRequest into a JSON request body.