File tree Expand file tree Collapse file tree 2 files changed +8
-0
lines changed
main/java/graphql/kickstart/spring/webclient/boot
test/java/graphql/kickstart/spring/webclient/boot Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -21,6 +21,8 @@ public class GraphQLResponse {
2121
2222 public static final String ERRORS_FIELD = "errors" ;
2323
24+ @ Getter
25+ private final String rawResponse ;
2426 private final JsonNode data ;
2527 @ Getter
2628 private final List <GraphQLError > errors ;
@@ -29,6 +31,7 @@ public class GraphQLResponse {
2931 private ReadContext readContext ;
3032
3133 GraphQLResponse (String rawResponse , ObjectMapper objectMapper ) {
34+ this .rawResponse = rawResponse ;
3235 this .objectMapper = objectMapper ;
3336
3437 JsonNode tree = readTree (rawResponse );
Original file line number Diff line number Diff line change @@ -101,6 +101,11 @@ void getList_dataFieldExists_returnsList() {
101101 }
102102
103103 @ Test
104+ void getRawResponse () {
105+ GraphQLResponse response = constructResponse ("{ \" data\" : null }" );
106+ assertEquals ("{ \" data\" : null }" , response .getRawResponse ());
107+ }
108+
104109 void getAt_dataFieldExists_returnsValue () {
105110 GraphQLResponse response = constructResponse ("{ \" data\" : { \" field\" : { \" innerField\" : \" value\" } } }" );
106111 String value = response .getAt ("field.innerField" , String .class );
You can’t perform that action at this time.
0 commit comments