Class GraphQLResponseDto<T>
java.lang.Object
de.qytera.qtaf.xray.dto.response.graphql.GraphQLResponseDto<T>
- Type Parameters:
T- the type of the returned data
- Direct Known Subclasses:
XrayCloudTestStepResponseDto
Represents a generic GraphQL response. These always consist of a data property and an optional array of errors.
A successful response could look like this:
An erroneous response could look like this:
A successful response could look like this:
{
"data": {
"getTests": {
"total": 10,
"start": 0,
"results": [
{
"issueId": "12345"
},
{
"issueId": "45678"
}
]
}
}
}
An erroneous response could look like this:
{
"errors": [
{
"message": "Invalid JQL query",
"locations": [
{
"line": 2,
"column": 3
}
],
"path": [
"getTests"
]
}
],
"data": {
"getTests": null
}
}
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns a summary of all errors that occurred during request handling.getData()Response payload.Error DTO.booleanWhether the response contains any errors.voidResponse payload.voidsetErrors(GraphQLResponseErrorDto[] errors) Error DTO.
-
Constructor Details
-
GraphQLResponseDto
public GraphQLResponseDto()
-
-
Method Details
-
hasErrors
public boolean hasErrors()Whether the response contains any errors.- Returns:
- true if it contains an error, false otherwise
-
errorReason
Returns a summary of all errors that occurred during request handling.- Returns:
- the error summary
- Throws:
IllegalStateException- if the response does not contain any errors
-
getData
Response payload. -
getErrors
Error DTO. -
setData
Response payload. -
setErrors
Error DTO.
-