use of io.smallrye.graphql.client.impl.ResponseReader in project smallrye-graphql by smallrye.
the class ResultBuilder method readErrors.
private void readErrors() {
if (!response.containsKey("errors") || response.isNull("errors"))
return;
JsonArray jsonErrors = response.getJsonArray("errors");
if (jsonErrors == null)
return;
JsonArray unapplied = jsonErrors.stream().filter(error -> !apply(error)).collect(toJsonArray());
if (unapplied.isEmpty())
return;
throw new GraphQLClientException("errors from service", unapplied.stream().map(ResponseReader::readError).collect(Collectors.toList()));
}
Aggregations