From 651700ca629772d6cbcc47492c1fe0b26a06dff6 Mon Sep 17 00:00:00 2001 From: Jonttuuu <50843099+Jonttuuu@users.noreply.github.com> Date: Sun, 30 Jul 2023 14:36:56 +0300 Subject: [PATCH] Fix GraphQL formatting --- src/main/java/fi/flexplex/lib/GraphQLApi.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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();