protected class GraphConverter.GraphResponseConverter<T> extends java.lang.Object implements retrofit2.Converter<okhttp3.ResponseBody,GraphQLResponse<T>>
Modifier and Type | Field and Description |
---|---|
protected java.lang.reflect.ParameterizedType |
graphResponseType |
protected java.lang.reflect.Type |
resultType |
Modifier | Constructor and Description |
---|---|
protected |
GraphResponseConverter(java.lang.reflect.ParameterizedType graphResponseType)
Sole constructor.
|
Modifier and Type | Method and Description |
---|---|
GraphQLResponse<T> |
convert(okhttp3.ResponseBody responseBody)
Converts the response body into a GraphQL response.
|
protected java.lang.reflect.ParameterizedType graphResponseType
protected java.lang.reflect.Type resultType
protected GraphResponseConverter(java.lang.reflect.ParameterizedType graphResponseType)
graphResponseType
- the graph response typepublic GraphQLResponse<T> convert(okhttp3.ResponseBody responseBody)
Converter contains logic on how to handle responses, since GraphQL responses follow the JsonAPI spec it makes sense to wrap our base query response results and errors response in here, the logic remains open to the implementation.
convert
in interface retrofit2.Converter<okhttp3.ResponseBody,GraphQLResponse<T>>
responseBody
- the retrofit response body received from the network