Package io.smallrye.graphql.client
Interface Response
public interface Response
-
Method Summary
Modifier and TypeMethodDescriptionjakarta.json.JsonObjectgetData()The 'data' object contained in the response.List of errors contained in this response.jakarta.json.JsonObjectList of user-made extensions contained in this response.<T> List<T> Transform the contents of the `rootField` from this response into a list of objects of the requested type.<T> TTransform the contents of the `rootField` from this response into an object of the requested type.Get transport-specific metadata that came from the server with this response.booleanhasData()If this response contains any data, this returns `true`; `false` otherwise.booleanhasError()If this response contains at least one error, this returns `true`; `false` otherwise.booleanIf this response contains any extensions, this returns `true`; `false` otherwise.
-
Method Details
-
getData
jakarta.json.JsonObject getData()The 'data' object contained in the response. Can be JsonValue.NULL if the response contains an empty field, or `null` if the response does not contain this field at all. -
getErrors
List<GraphQLError> getErrors()List of errors contained in this response. -
getExtensions
jakarta.json.JsonObject getExtensions()List of user-made extensions contained in this response. -
getList
Transform the contents of the `rootField` from this response into a list of objects of the requested type. If the response contains this field but it is a single object rather than a list, this method throws an exception. If the response does not contain this field at all, this method throws an exception. If the response contains this field but with a null value, this method returns null. -
getObject
Transform the contents of the `rootField` from this response into an object of the requested type. If the response does not contain this field at all, this method throws an exception. If the response contains this field but it is null, this method returns null. -
hasData
boolean hasData()If this response contains any data, this returns `true`; `false` otherwise. -
hasError
boolean hasError()If this response contains at least one error, this returns `true`; `false` otherwise. -
hasExtensions
boolean hasExtensions()If this response contains any extensions, this returns `true`; `false` otherwise. -
getTransportMeta
Get transport-specific metadata that came from the server with this response.
-