Skip to content

Commit

Permalink
invoke (#864)
Browse files Browse the repository at this point in the history
Co-authored-by: Jan-Olav Eide <[email protected]>
  • Loading branch information
jan-olaveide and janolaveide authored Jun 23, 2021
1 parent 71511ee commit e712a66
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,13 @@ public List<Journalpost> hentTilknyttedeJournalposter(TilknyttedeJournalposterQu
public byte[] hentDokument(HentDokumentQuery q) {
try {
LOG.trace("Henter dokument");
var doc = client.target(base)
var doc = invoke(client.target(base)
.path(HENTDOKUMENT)
.resolveTemplate("journalpostId", q.getJournalpostId())
.resolveTemplate("dokumentInfoId", q.getDokumentInfoId())
.resolveTemplate("variantFormat", q.getVariantFormat())
.request()
.get(byte[].class);
.buildGet(), byte[].class);
LOG.info("Hentet dokument OK");
return doc;
} catch (WebApplicationException e) {
Expand All @@ -100,11 +100,10 @@ public <T extends GraphQLResult<?>> T query(GraphQLOperationRequest req, GraphQL
private <T extends GraphQLResult<?>> T query(GraphQLRequest req, Class<T> clazz) {
try {
LOG.trace("Eksekverer GraphQL query {}", req.getClass().getSimpleName());
var res = client.target(base)
var res = invoke(client.target(base)
.path(GRAPHQL)
.request(APPLICATION_JSON_TYPE)
.buildPost(json(req.toHttpJsonBody()))
.invoke(clazz);
.buildPost(json(req.toHttpJsonBody())), clazz);
if (res.hasErrors()) {
return errorHandler.handleError(res.getErrors(), base, F_240613);
}
Expand Down

0 comments on commit e712a66

Please sign in to comment.