File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed
src/main/java/graphql/servlet Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change 1414 */
1515package graphql .servlet ;
1616
17- import com .fasterxml .jackson .annotation .JsonRawValue ;
17+ import com .fasterxml .jackson .annotation .JsonProperty ;
1818import com .fasterxml .jackson .core .type .TypeReference ;
1919import com .fasterxml .jackson .databind .ObjectMapper ;
2020import com .google .common .io .CharStreams ;
@@ -165,10 +165,20 @@ public String executeQuery(String query) {
165165 public static class Request {
166166 @ Getter @ Setter
167167 private String query ;
168- @ Getter @ Setter
168+ @ Getter
169169 private Map <String , Object > variables = new HashMap <>();
170170 @ Getter @ Setter
171171 private String operationName ;
172+
173+ @ SneakyThrows @ JsonProperty ("variables" )
174+ public String getVariablesAsString () {
175+ return new ObjectMapper ().writeValueAsString (variables );
176+ }
177+
178+ @ SneakyThrows
179+ public void setVariables (String variables ) {
180+ this .variables = new ObjectMapper ().readValue (variables , new TypeReference <Map <String , Object >>() {});
181+ }
172182 }
173183
174184 @ Override
You can’t perform that action at this time.
0 commit comments