diff --git a/server/implementation/src/main/java/io/smallrye/graphql/execution/error/ExecutionErrorsService.java b/server/implementation/src/main/java/io/smallrye/graphql/execution/error/ExecutionErrorsService.java index 5e5700032..c95cf873e 100644 --- a/server/implementation/src/main/java/io/smallrye/graphql/execution/error/ExecutionErrorsService.java +++ b/server/implementation/src/main/java/io/smallrye/graphql/execution/error/ExecutionErrorsService.java @@ -132,9 +132,7 @@ private void addKeyValue(JsonObjectBuilder objectBuilder, String key, String val } private void addKeyValue(JsonObjectBuilder objectBuilder, String key, JsonValue value) { - if (value == null) { - return; - } + value = value != null ? value : JsonValue.NULL; if (config.getErrorExtensionFields().isPresent()) { List fieldsThatShouldBeIncluded = config.getErrorExtensionFields().get(); if (fieldsThatShouldBeIncluded.contains(key)) {