From f59867eb5d6003074e1b1b12c024ae2cc2a06cab Mon Sep 17 00:00:00 2001 From: Ruediger zu Dohna Date: Fri, 8 Mar 2024 09:47:08 +0100 Subject: [PATCH 1/2] fix #2051: add `java.lang.Deprecated` to `IndexInitializer` --- .../java/io/smallrye/graphql/entry/http/IndexInitializer.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/implementation-servlet/src/main/java/io/smallrye/graphql/entry/http/IndexInitializer.java b/server/implementation-servlet/src/main/java/io/smallrye/graphql/entry/http/IndexInitializer.java index 2fd0ff55c..92610c307 100644 --- a/server/implementation-servlet/src/main/java/io/smallrye/graphql/entry/http/IndexInitializer.java +++ b/server/implementation-servlet/src/main/java/io/smallrye/graphql/entry/http/IndexInitializer.java @@ -28,7 +28,6 @@ import org.jboss.jandex.IndexView; import org.jboss.jandex.Indexer; -import io.smallrye.graphql.api.Deprecated; import io.smallrye.graphql.api.Entry; import io.smallrye.graphql.api.OneOf; import io.smallrye.graphql.api.federation.Authenticated; @@ -103,7 +102,8 @@ private IndexView createCustomIndex() { // directives from the API module indexer.index(convertClassToInputStream(Authenticated.class)); indexer.index(convertClassToInputStream(ComposeDirective.class)); - indexer.index(convertClassToInputStream(Deprecated.class)); + indexer.index(convertClassToInputStream(io.smallrye.graphql.api.Deprecated.class)); + indexer.index(convertClassToInputStream(java.lang.Deprecated.class)); indexer.index(convertClassToInputStream(Extends.class)); indexer.index(convertClassToInputStream(External.class)); indexer.index(convertClassToInputStream(FieldSet.class)); From 0a4e40fed3707338d09cda5e73823d8377de9dc7 Mon Sep 17 00:00:00 2001 From: Ruediger zu Dohna Date: Wed, 24 Apr 2024 07:47:43 +0200 Subject: [PATCH 2/2] fix #2094: remove dependency client/impl->jandex --- client/implementation/pom.xml | 4 ---- .../io/smallrye/graphql/client/impl/RequestImpl.java | 10 ++++------ 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/client/implementation/pom.xml b/client/implementation/pom.xml index 9c8d9fd91..31b601218 100644 --- a/client/implementation/pom.xml +++ b/client/implementation/pom.xml @@ -70,10 +70,6 @@ jakarta.json jakarta.json-api - - org.eclipse - yasson - io.smallrye.reactive mutiny diff --git a/client/implementation/src/main/java/io/smallrye/graphql/client/impl/RequestImpl.java b/client/implementation/src/main/java/io/smallrye/graphql/client/impl/RequestImpl.java index 4085634a1..deceb9c30 100644 --- a/client/implementation/src/main/java/io/smallrye/graphql/client/impl/RequestImpl.java +++ b/client/implementation/src/main/java/io/smallrye/graphql/client/impl/RequestImpl.java @@ -1,5 +1,6 @@ package io.smallrye.graphql.client.impl; +import java.io.StringReader; import java.util.HashMap; import java.util.Map; import java.util.Objects; @@ -8,13 +9,10 @@ import jakarta.json.JsonBuilderFactory; import jakarta.json.JsonObject; import jakarta.json.JsonObjectBuilder; -import jakarta.json.JsonStructure; import jakarta.json.JsonValue; import jakarta.json.bind.Jsonb; import jakarta.json.bind.JsonbBuilder; -import org.eclipse.yasson.internal.JsonBinding; - import io.smallrye.graphql.client.Request; public class RequestImpl implements Request { @@ -73,9 +71,9 @@ private JsonObject _formatJsonVariables() { varBuilder.addNull(k); } else { try (Jsonb jsonb = JsonbBuilder.create()) { - JsonStructure struct = ((JsonBinding) jsonb).toJsonStructure(v); - varBuilder.add(k, struct); - } catch (Exception ignore) { + varBuilder.add(k, Json.createReader(new StringReader(jsonb.toJson(v))).read()); + } catch (Exception e) { + throw new RuntimeException("Error converting variable to JSON", e); } } });