in src/main/java/org/apache/sling/graphql/core/servlet/GraphQLServlet.java [331:342]
private void execute(@NotNull String persistedQuery, SlingHttpServletRequest request, SlingHttpServletResponse response) throws IOException {
response.setContentType("application/json");
response.setCharacterEncoding("UTF-8");
try (JsonWriter writer = Json.createWriter(response.getWriter())) {
final QueryParser.Result result = QueryParser.fromJSON(persistedQuery);
Map<String, Object> executionResult = queryExecutor.execute(result.getQuery(), result.getVariables(), request.getResource(),
request.getRequestPathInfo().getSelectors());
writer.write(Json.createObjectBuilder(executionResult).build().asJsonObject());
} catch (Exception ex) {
throw new IOException(ex);
}
}