I recently work with commerce tools platform and I have such a question.
I have this query:
CompletionStage<List<Category>> stage = QueryExecutionUtils.queryAll(client, CategoryQuery.of().byName(Locale.ENGLISH, "cat1"));
final CompletableFuture<List<Category>> result = stage.toCompletableFuture();
return result.get().get(0);
Is there a way to return just a Category instead of List.get(0) and how it can be done?