From f0866b639c0d125f7994e687176f7e9d4b1b5612 Mon Sep 17 00:00:00 2001 From: Jan Martiska Date: Thu, 2 Nov 2023 14:30:56 +0100 Subject: [PATCH 1/2] Option to register some scalars from graphql-java-extended-scalars --- .../java/io/smallrye/graphql/schema/model/Scalars.java | 8 +++++++- pom.xml | 7 +++++++ server/implementation/pom.xml | 5 +++++ .../io/smallrye/graphql/scalar/GraphQLScalarTypes.java | 6 ++++++ 4 files changed, 25 insertions(+), 1 deletion(-) diff --git a/common/schema-model/src/main/java/io/smallrye/graphql/schema/model/Scalars.java b/common/schema-model/src/main/java/io/smallrye/graphql/schema/model/Scalars.java index 2dc1feff0..901feab8c 100644 --- a/common/schema-model/src/main/java/io/smallrye/graphql/schema/model/Scalars.java +++ b/common/schema-model/src/main/java/io/smallrye/graphql/schema/model/Scalars.java @@ -94,6 +94,12 @@ public static Reference getIDScalar(String className) { .build(); } + // this is for the UUID from graphql-java-extended-scalars + // if used, it will override the original UUID type that is mapped to a String in the schema + public static void addUuid() { + populateScalar(UUID.class.getName(), "UUID", String.class.getName()); + } + static { // The main java type should go first. @@ -185,7 +191,7 @@ private static void populateScalar(String className, String scalarName, String e scalarMap.put(className, reference); // looking up by name - scalarNameMap.putIfAbsent(scalarName, reference); + scalarNameMap.put(scalarName, reference); //Currently, each scalar is formatted as String formattedScalarMap.put(className, new Reference.Builder() diff --git a/pom.xml b/pom.xml index ac9e199de..fff4bee87 100644 --- a/pom.xml +++ b/pom.xml @@ -38,6 +38,7 @@ 2.0.0 2.1.1 21.1 + 21.0 1.11.3 4.4.5 2.4.0 @@ -352,6 +353,12 @@ ${project.version} + + com.graphql-java + graphql-java-extended-scalars + ${version.extended-scalars} + + org.jboss.arquillian.container diff --git a/server/implementation/pom.xml b/server/implementation/pom.xml index 610d205aa..e14dee524 100644 --- a/server/implementation/pom.xml +++ b/server/implementation/pom.xml @@ -71,6 +71,11 @@ provided + + com.graphql-java + graphql-java-extended-scalars + + org.jboss.logging diff --git a/server/implementation/src/main/java/io/smallrye/graphql/scalar/GraphQLScalarTypes.java b/server/implementation/src/main/java/io/smallrye/graphql/scalar/GraphQLScalarTypes.java index 94bba5bb9..3f33f4180 100644 --- a/server/implementation/src/main/java/io/smallrye/graphql/scalar/GraphQLScalarTypes.java +++ b/server/implementation/src/main/java/io/smallrye/graphql/scalar/GraphQLScalarTypes.java @@ -7,6 +7,7 @@ import java.util.UUID; import graphql.Scalars; +import graphql.scalars.ExtendedScalars; import graphql.schema.GraphQLScalarType; import io.smallrye.graphql.scalar.number.BigDecimalScalar; import io.smallrye.graphql.scalar.number.BigIntegerScalar; @@ -46,6 +47,11 @@ public static boolean isGraphQLScalarType(String className) { return SCALAR_MAP.containsKey(className); } + public static void addUuid() { + SCALAR_MAP.put(UUID.class.getName(), ExtendedScalars.UUID); + SCALARS_BY_NAME.put(ExtendedScalars.UUID.getName(), ExtendedScalars.UUID); + } + // Scalar map we can just create now. private static final Map SCALAR_MAP = new HashMap<>(); From 79872e3ed89787216b102aa2ff2b095dbea88633 Mon Sep 17 00:00:00 2001 From: Jan Martiska Date: Thu, 9 Nov 2023 07:48:50 +0100 Subject: [PATCH 2/2] Bump to 2.6.0-SNAPSHOT --- client/api/pom.xml | 2 +- client/generator-test/pom.xml | 2 +- client/generator/pom.xml | 2 +- client/implementation-vertx/pom.xml | 2 +- client/implementation/pom.xml | 2 +- client/pom.xml | 2 +- client/tck/pom.xml | 2 +- common/pom.xml | 2 +- common/schema-builder/pom.xml | 2 +- common/schema-model/pom.xml | 2 +- docs/pom.xml | 2 +- pom.xml | 2 +- release/pom.xml | 2 +- server/api/pom.xml | 2 +- server/implementation-cdi/pom.xml | 2 +- server/implementation-servlet/pom.xml | 2 +- server/implementation/pom.xml | 2 +- server/integration-tests-jdk16/pom.xml | 2 +- server/integration-tests/pom.xml | 2 +- server/pom.xml | 2 +- server/runner/pom.xml | 2 +- server/tck/pom.xml | 2 +- tools/gradle-plugin/pom.xml | 2 +- tools/maven-plugin-tests/pom.xml | 2 +- tools/maven-plugin/pom.xml | 2 +- tools/pom.xml | 2 +- ui/graphiql/pom.xml | 2 +- ui/pom.xml | 2 +- 28 files changed, 28 insertions(+), 28 deletions(-) diff --git a/client/api/pom.xml b/client/api/pom.xml index 1660c38ec..88b5f11b5 100644 --- a/client/api/pom.xml +++ b/client/api/pom.xml @@ -5,7 +5,7 @@ io.smallrye smallrye-graphql-client-parent - 2.5.2-SNAPSHOT + 2.6.0-SNAPSHOT smallrye-graphql-client-api diff --git a/client/generator-test/pom.xml b/client/generator-test/pom.xml index c365f2e26..9e699b159 100644 --- a/client/generator-test/pom.xml +++ b/client/generator-test/pom.xml @@ -4,7 +4,7 @@ io.smallrye smallrye-graphql-client-parent - 2.5.2-SNAPSHOT + 2.6.0-SNAPSHOT smallrye-graphql-client-generator-test diff --git a/client/generator/pom.xml b/client/generator/pom.xml index a09cf05e9..5cec10bfb 100644 --- a/client/generator/pom.xml +++ b/client/generator/pom.xml @@ -4,7 +4,7 @@ io.smallrye smallrye-graphql-client-parent - 2.5.2-SNAPSHOT + 2.6.0-SNAPSHOT smallrye-graphql-client-generator diff --git a/client/implementation-vertx/pom.xml b/client/implementation-vertx/pom.xml index 63ace604c..ad7816b33 100644 --- a/client/implementation-vertx/pom.xml +++ b/client/implementation-vertx/pom.xml @@ -5,7 +5,7 @@ io.smallrye smallrye-graphql-client-parent - 2.5.2-SNAPSHOT + 2.6.0-SNAPSHOT smallrye-graphql-client-implementation-vertx diff --git a/client/implementation/pom.xml b/client/implementation/pom.xml index 814c8329f..5525a8af1 100644 --- a/client/implementation/pom.xml +++ b/client/implementation/pom.xml @@ -5,7 +5,7 @@ io.smallrye smallrye-graphql-client-parent - 2.5.2-SNAPSHOT + 2.6.0-SNAPSHOT smallrye-graphql-client diff --git a/client/pom.xml b/client/pom.xml index 635fe8ff6..e47d23052 100644 --- a/client/pom.xml +++ b/client/pom.xml @@ -5,7 +5,7 @@ io.smallrye smallrye-graphql-parent - 2.5.2-SNAPSHOT + 2.6.0-SNAPSHOT smallrye-graphql-client-parent diff --git a/client/tck/pom.xml b/client/tck/pom.xml index 3df5bd195..c4e2b830d 100644 --- a/client/tck/pom.xml +++ b/client/tck/pom.xml @@ -5,7 +5,7 @@ io.smallrye smallrye-graphql-client-parent - 2.5.2-SNAPSHOT + 2.6.0-SNAPSHOT smallrye-graphql-client-tck diff --git a/common/pom.xml b/common/pom.xml index c55a1732a..82f5bb014 100644 --- a/common/pom.xml +++ b/common/pom.xml @@ -5,7 +5,7 @@ io.smallrye smallrye-graphql-parent - 2.5.2-SNAPSHOT + 2.6.0-SNAPSHOT smallrye-graphql-common-parent diff --git a/common/schema-builder/pom.xml b/common/schema-builder/pom.xml index 95dcaf50d..d99b60bc7 100644 --- a/common/schema-builder/pom.xml +++ b/common/schema-builder/pom.xml @@ -5,7 +5,7 @@ io.smallrye smallrye-graphql-common-parent - 2.5.2-SNAPSHOT + 2.6.0-SNAPSHOT smallrye-graphql-schema-builder diff --git a/common/schema-model/pom.xml b/common/schema-model/pom.xml index 915da0486..3fef1537b 100644 --- a/common/schema-model/pom.xml +++ b/common/schema-model/pom.xml @@ -4,7 +4,7 @@ io.smallrye smallrye-graphql-common-parent - 2.5.2-SNAPSHOT + 2.6.0-SNAPSHOT smallrye-graphql-schema-model diff --git a/docs/pom.xml b/docs/pom.xml index fff31a86b..33f179f9a 100644 --- a/docs/pom.xml +++ b/docs/pom.xml @@ -5,7 +5,7 @@ io.smallrye smallrye-graphql-parent - 2.5.2-SNAPSHOT + 2.6.0-SNAPSHOT smallrye-graphql-documentation diff --git a/pom.xml b/pom.xml index fff4bee87..96e1c82f4 100644 --- a/pom.xml +++ b/pom.xml @@ -9,7 +9,7 @@ smallrye-graphql-parent - 2.5.2-SNAPSHOT + 2.6.0-SNAPSHOT pom SmallRye: GraphQL Parent diff --git a/release/pom.xml b/release/pom.xml index e3ba464fd..40aa5f52c 100644 --- a/release/pom.xml +++ b/release/pom.xml @@ -5,7 +5,7 @@ io.smallrye smallrye-graphql-parent - 2.5.2-SNAPSHOT + 2.6.0-SNAPSHOT smallrye-graphql-release diff --git a/server/api/pom.xml b/server/api/pom.xml index 46825853c..ae74f4fc5 100644 --- a/server/api/pom.xml +++ b/server/api/pom.xml @@ -5,7 +5,7 @@ io.smallrye smallrye-graphql-server-parent - 2.5.2-SNAPSHOT + 2.6.0-SNAPSHOT smallrye-graphql-api diff --git a/server/implementation-cdi/pom.xml b/server/implementation-cdi/pom.xml index 4b118555e..4f9350655 100644 --- a/server/implementation-cdi/pom.xml +++ b/server/implementation-cdi/pom.xml @@ -5,7 +5,7 @@ io.smallrye smallrye-graphql-server-parent - 2.5.2-SNAPSHOT + 2.6.0-SNAPSHOT smallrye-graphql-cdi diff --git a/server/implementation-servlet/pom.xml b/server/implementation-servlet/pom.xml index 2be28523f..fcfc61858 100644 --- a/server/implementation-servlet/pom.xml +++ b/server/implementation-servlet/pom.xml @@ -5,7 +5,7 @@ io.smallrye smallrye-graphql-server-parent - 2.5.2-SNAPSHOT + 2.6.0-SNAPSHOT smallrye-graphql-servlet diff --git a/server/implementation/pom.xml b/server/implementation/pom.xml index e14dee524..a6aa1f138 100644 --- a/server/implementation/pom.xml +++ b/server/implementation/pom.xml @@ -5,7 +5,7 @@ io.smallrye smallrye-graphql-server-parent - 2.5.2-SNAPSHOT + 2.6.0-SNAPSHOT smallrye-graphql diff --git a/server/integration-tests-jdk16/pom.xml b/server/integration-tests-jdk16/pom.xml index c675cdefa..764224931 100644 --- a/server/integration-tests-jdk16/pom.xml +++ b/server/integration-tests-jdk16/pom.xml @@ -3,7 +3,7 @@ smallrye-graphql-server-parent io.smallrye - 2.5.2-SNAPSHOT + 2.6.0-SNAPSHOT 4.0.0 diff --git a/server/integration-tests/pom.xml b/server/integration-tests/pom.xml index ed3fd51f4..436450fb6 100644 --- a/server/integration-tests/pom.xml +++ b/server/integration-tests/pom.xml @@ -4,7 +4,7 @@ io.smallrye smallrye-graphql-server-parent - 2.5.2-SNAPSHOT + 2.6.0-SNAPSHOT 4.0.0 diff --git a/server/pom.xml b/server/pom.xml index fb7b6b3f9..1db59953b 100644 --- a/server/pom.xml +++ b/server/pom.xml @@ -5,7 +5,7 @@ io.smallrye smallrye-graphql-parent - 2.5.2-SNAPSHOT + 2.6.0-SNAPSHOT smallrye-graphql-server-parent diff --git a/server/runner/pom.xml b/server/runner/pom.xml index 27a016200..926f7ee4d 100644 --- a/server/runner/pom.xml +++ b/server/runner/pom.xml @@ -5,7 +5,7 @@ io.smallrye smallrye-graphql-server-parent - 2.5.2-SNAPSHOT + 2.6.0-SNAPSHOT smallrye-graphql-runner diff --git a/server/tck/pom.xml b/server/tck/pom.xml index e28f137b1..1723c0a79 100644 --- a/server/tck/pom.xml +++ b/server/tck/pom.xml @@ -4,7 +4,7 @@ io.smallrye smallrye-graphql-server-parent - 2.5.2-SNAPSHOT + 2.6.0-SNAPSHOT smallrye-graphql-tck diff --git a/tools/gradle-plugin/pom.xml b/tools/gradle-plugin/pom.xml index 16a93195f..4fbd3f463 100644 --- a/tools/gradle-plugin/pom.xml +++ b/tools/gradle-plugin/pom.xml @@ -4,7 +4,7 @@ io.smallrye smallrye-graphql-tools-parent - 2.5.2-SNAPSHOT + 2.6.0-SNAPSHOT 4.0.0 diff --git a/tools/maven-plugin-tests/pom.xml b/tools/maven-plugin-tests/pom.xml index 7a9b31a6e..9c4013590 100644 --- a/tools/maven-plugin-tests/pom.xml +++ b/tools/maven-plugin-tests/pom.xml @@ -3,7 +3,7 @@ io.smallrye smallrye-graphql-tools-parent - 2.5.2-SNAPSHOT + 2.6.0-SNAPSHOT 4.0.0 diff --git a/tools/maven-plugin/pom.xml b/tools/maven-plugin/pom.xml index da270cb71..0db9214fa 100644 --- a/tools/maven-plugin/pom.xml +++ b/tools/maven-plugin/pom.xml @@ -3,7 +3,7 @@ io.smallrye smallrye-graphql-tools-parent - 2.5.2-SNAPSHOT + 2.6.0-SNAPSHOT 4.0.0 diff --git a/tools/pom.xml b/tools/pom.xml index a10b215f4..4589723f8 100644 --- a/tools/pom.xml +++ b/tools/pom.xml @@ -5,7 +5,7 @@ io.smallrye smallrye-graphql-parent - 2.5.2-SNAPSHOT + 2.6.0-SNAPSHOT smallrye-graphql-tools-parent diff --git a/ui/graphiql/pom.xml b/ui/graphiql/pom.xml index 640a3a24f..8439576bc 100644 --- a/ui/graphiql/pom.xml +++ b/ui/graphiql/pom.xml @@ -5,7 +5,7 @@ io.smallrye smallrye-graphql-ui-parent - 2.5.2-SNAPSHOT + 2.6.0-SNAPSHOT smallrye-graphql-ui-graphiql diff --git a/ui/pom.xml b/ui/pom.xml index f8c4eda14..2d30aa6e4 100644 --- a/ui/pom.xml +++ b/ui/pom.xml @@ -5,7 +5,7 @@ io.smallrye smallrye-graphql-parent - 2.5.2-SNAPSHOT + 2.6.0-SNAPSHOT smallrye-graphql-ui-parent