Regarding execution of graphql here:
|
Map<String, Object> result = new HashMap<>(); |
|
if (executionResult.getErrors().size() > 0) { |
|
result.put(GRAPHQL_RESPONSE_ERROR_KEY, executionResult.getErrors()); |
|
logger.error("Errors: {}", executionResult.getErrors()); |
|
} else { |
|
result.put(GRAPHQL_RESPONSE_DATA_KEY, executionResult.getData()); |
|
} |
|
exchange.getResponseHeaders().put(Headers.CONTENT_TYPE, "application/json"); |
|
exchange.setStatusCode(StatusCodes.OK); |
|
exchange.getResponseSender().send(Config.getInstance().getMapper().writeValueAsString(result)); |
GraphQL also provides an extensions, perhaps we should add it.
if (executionResult.getExtensions().size() > 0) {
result.put("extensions", executionResult.getExtensions());
}
Regarding execution of graphql here:
light-graphql-4j/graphql-router/src/main/java/com/networknt/graphql/router/handlers/GraphqlPostHandler.java
Lines 91 to 100 in a74f1a5
GraphQL also provides an
extensions, perhaps we should add it.