diff --git a/src/main/java/fi/flexplex/lib/GraphQLApi.java b/src/main/java/fi/flexplex/lib/GraphQLApi.java index 2913dac..8a469ca 100644 --- a/src/main/java/fi/flexplex/lib/GraphQLApi.java +++ b/src/main/java/fi/flexplex/lib/GraphQLApi.java @@ -28,7 +28,7 @@ public final class GraphQLApi { protected Optional execute(final String query) { final HttpResponse response; final HttpRequest request = HttpRequest.newBuilder() - .POST(HttpRequest.BodyPublishers.ofString("{\"query\":\"" + query + "\"}")) + .POST(HttpRequest.BodyPublishers.ofString("{\"query\":\"" + query.replace("\"", "\\\"") + "\"}")) .uri(this.uri) .build();