Fix GraphQL formatting

This commit is contained in:
Jonttuuu 2023-07-30 14:36:56 +03:00
parent 413800515f
commit 651700ca62

View File

@ -28,7 +28,7 @@ public final class GraphQLApi {
protected Optional<JsonObject> execute(final String query) {
final HttpResponse<String> response;
final HttpRequest request = HttpRequest.newBuilder()
.POST(HttpRequest.BodyPublishers.ofString("{\"query\":\"" + query + "\"}"))
.POST(HttpRequest.BodyPublishers.ofString("{\"query\":\"" + query.replace("\"", "\\\"") + "\"}"))
.uri(this.uri)
.build();