Skip to content

Commit

Permalink
UNOMI-667: Upgrade GraphQL-Java & other dependencies to the latest ve…
Browse files Browse the repository at this point in the history
…rsions
  • Loading branch information
anatol-sialitski committed Feb 21, 2023
1 parent 801b1fd commit a5b5d72
Show file tree
Hide file tree
Showing 13 changed files with 81 additions and 176 deletions.
10 changes: 10 additions & 0 deletions graphql/cxs-impl/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,16 @@
<artifactId>graphql-java-annotations</artifactId>
<version>${graphql.java.annotations.version}</version>
<scope>provided</scope>
<exclusions>
<exclusion>
<groupId>com.graphql-java</groupId>
<artifactId>graphql-java</artifactId>
</exclusion>
<exclusion>
<groupId>com.graphql-java</groupId>
<artifactId>graphql-java-extended-scalars</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.graphql-java</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,11 @@
package org.apache.unomi.graphql.converters;

import graphql.Scalars;
import graphql.scalars.ExtendedScalars;
import graphql.schema.GraphQLList;
import graphql.schema.GraphQLNonNull;
import graphql.schema.GraphQLType;
import org.apache.unomi.graphql.scalars.DateTimeFunction;
import org.apache.unomi.graphql.scalars.GeoPointFunction;
import org.apache.unomi.graphql.scalars.JSONFunction;
import org.apache.unomi.graphql.schema.PropertyNameTranslator;
import org.apache.unomi.graphql.utils.StringUtils;

Expand Down Expand Up @@ -56,20 +55,20 @@ static GraphQLType convertPropertyType(final String type) {
graphQLType = Scalars.GraphQLInt;
break;
case "long":
graphQLType = Scalars.GraphQLLong;
graphQLType = ExtendedScalars.GraphQLLong;
break;
case "float":
graphQLType = Scalars.GraphQLFloat;
break;
case "set":
case "json":
graphQLType = JSONFunction.JSON_SCALAR;
graphQLType = ExtendedScalars.Json;
break;
case "geopoint":
graphQLType = GeoPointFunction.GEOPOINT_SCALAR;
break;
case "date":
graphQLType = DateTimeFunction.DATE_TIME_SCALAR;
graphQLType = ExtendedScalars.DateTime;
break;
case "boolean":
graphQLType = Scalars.GraphQLBoolean;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,7 @@
package org.apache.unomi.graphql.providers;

import graphql.annotations.processor.typeFunctions.TypeFunction;
import org.apache.unomi.graphql.scalars.DateFunction;
import org.apache.unomi.graphql.scalars.DateTimeFunction;
import org.apache.unomi.graphql.scalars.GeoPointFunction;
import org.apache.unomi.graphql.scalars.JSONFunction;
import org.apache.unomi.graphql.types.input.CDPGeoDistanceFilterInput;
import org.apache.unomi.graphql.types.input.CDPProfileUpdateEventFilterInput;
import org.apache.unomi.graphql.types.input.CDPProfileUpdateEventInput;
Expand Down Expand Up @@ -87,9 +84,6 @@ public Set<Class<?>> getAdditionalInputTypes() {
public Set<TypeFunction> getTypeFunctions() {
final Set<TypeFunction> typeFunctions = new HashSet<>();

typeFunctions.add(new DateTimeFunction());
typeFunctions.add(new DateFunction());
typeFunctions.add(new JSONFunction());
typeFunctions.add(new GeoPointFunction());

return typeFunctions;
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,10 @@

import graphql.Scalars;
import graphql.annotations.processor.GraphQLAnnotations;
import graphql.scalars.ExtendedScalars;
import graphql.schema.GraphQLInputObjectField;
import graphql.schema.GraphQLInputObjectType;
import graphql.schema.GraphQLInputType;
import org.apache.unomi.api.PropertyType;
import org.apache.unomi.graphql.scalars.DateTimeFunction;
import org.apache.unomi.graphql.scalars.GeoPointFunction;
import org.apache.unomi.graphql.types.input.CDPGeoDistanceFilterInput;
import org.apache.unomi.graphql.utils.ReflectionUtil;
Expand Down Expand Up @@ -74,23 +73,23 @@ private static void addFilters(final List<GraphQLInputObjectField> fieldDefiniti
} else if ("long".equals(propertyType.getTypeId())) {
fieldDefinitions.add(GraphQLInputObjectField.newInputObjectField()
.name(propertyName + "_equals")
.type(Scalars.GraphQLLong)
.type(ExtendedScalars.GraphQLLong)
.build());
fieldDefinitions.add(GraphQLInputObjectField.newInputObjectField()
.name(propertyName + "_lt")
.type(Scalars.GraphQLLong)
.type(ExtendedScalars.GraphQLLong)
.build());
fieldDefinitions.add(GraphQLInputObjectField.newInputObjectField()
.name(propertyName + "_lte")
.type(Scalars.GraphQLLong)
.type(ExtendedScalars.GraphQLLong)
.build());
fieldDefinitions.add(GraphQLInputObjectField.newInputObjectField()
.name(propertyName + "_gt")
.type(Scalars.GraphQLLong)
.type(ExtendedScalars.GraphQLLong)
.build());
fieldDefinitions.add(GraphQLInputObjectField.newInputObjectField()
.name(propertyName + "_gte")
.type(Scalars.GraphQLLong)
.type(ExtendedScalars.GraphQLLong)
.build());
} else if ("float".equals(propertyType.getTypeId())) {

Expand All @@ -117,23 +116,23 @@ private static void addFilters(final List<GraphQLInputObjectField> fieldDefiniti
} else if ("date".equals(propertyType.getTypeId())) {
fieldDefinitions.add(GraphQLInputObjectField.newInputObjectField()
.name(propertyName + "_equals")
.type(DateTimeFunction.DATE_TIME_SCALAR)
.type(ExtendedScalars.DateTime)
.build());
fieldDefinitions.add(GraphQLInputObjectField.newInputObjectField()
.name(propertyName + "_lt")
.type(DateTimeFunction.DATE_TIME_SCALAR)
.type(ExtendedScalars.DateTime)
.build());
fieldDefinitions.add(GraphQLInputObjectField.newInputObjectField()
.name(propertyName + "_lte")
.type(DateTimeFunction.DATE_TIME_SCALAR)
.type(ExtendedScalars.DateTime)
.build());
fieldDefinitions.add(GraphQLInputObjectField.newInputObjectField()
.name(propertyName + "_gt")
.type(DateTimeFunction.DATE_TIME_SCALAR)
.type(ExtendedScalars.DateTime)
.build());
fieldDefinitions.add(GraphQLInputObjectField.newInputObjectField()
.name(propertyName + "_gte")
.type(DateTimeFunction.DATE_TIME_SCALAR)
.type(ExtendedScalars.DateTime)
.build());
} else if ("boolean".equals(propertyType.getTypeId())) {
fieldDefinitions.add(GraphQLInputObjectField.newInputObjectField()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,14 @@
package org.apache.unomi.graphql.schema;

import graphql.Scalars;
import graphql.scalars.ExtendedScalars;
import graphql.schema.DataFetchingEnvironment;
import graphql.schema.GraphQLInputObjectType;
import graphql.schema.GraphQLInputType;
import graphql.schema.GraphQLObjectType;
import graphql.schema.GraphQLOutputType;
import graphql.schema.GraphQLScalarType;
import graphql.schema.GraphQLType;
import org.apache.unomi.graphql.scalars.DateFunction;
import org.apache.unomi.graphql.scalars.DateTimeFunction;

public class PropertyValueTypeHelper {

Expand Down Expand Up @@ -56,13 +55,13 @@ public static String getPropertyValueParameter(final GraphQLType fieldType) {

if (Scalars.GraphQLFloat.getName().equals(scalarType.getName())
|| Scalars.GraphQLInt.getName().equals(scalarType.getName())
|| Scalars.GraphQLLong.getName().equals(scalarType.getName())
|| Scalars.GraphQLFloat.getName().equals(scalarType.getName())
|| Scalars.GraphQLBigDecimal.getName().equals(scalarType.getName())
|| Scalars.GraphQLBigInteger.getName().equals(scalarType.getName())) {
|| ExtendedScalars.GraphQLBigDecimal.getName().equals(scalarType.getName())
|| ExtendedScalars.GraphQLLong.getName().equals(scalarType.getName())
|| ExtendedScalars.GraphQLBigInteger.getName().equals(scalarType.getName())) {
return "propertyValueInteger";
} else if (DateTimeFunction.DATE_TIME_SCALAR.getName().equals(scalarType.getName())
|| DateFunction.DATE_SCALAR.getName().equals(scalarType.getName())) {
} else if (ExtendedScalars.DateTime.getName().equals(scalarType.getName())
|| ExtendedScalars.Date.getName().equals(scalarType.getName())) {
return "propertyValueDate";
} else {
return "propertyValue";
Expand Down
12 changes: 11 additions & 1 deletion graphql/karaf-feature/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
<dependency>
<groupId>com.graphql-java</groupId>
<artifactId>java-dataloader</artifactId>
<version>2.2.0</version>
<version>${java.dataloader.version}</version>
</dependency>
<dependency>
<groupId>org.reactivestreams</groupId>
Expand All @@ -78,6 +78,16 @@
<groupId>io.github.graphql-java</groupId>
<artifactId>graphql-java-annotations</artifactId>
<version>${graphql.java.annotations.version}</version>
<exclusions>
<exclusion>
<groupId>com.graphql-java</groupId>
<artifactId>graphql-java</artifactId>
</exclusion>
<exclusion>
<groupId>com.graphql-java</groupId>
<artifactId>graphql-java-extended-scalars</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.graphql-java</groupId>
Expand Down
8 changes: 4 additions & 4 deletions graphql/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@
<packaging>pom</packaging>

<properties>
<graphql.java.version>14.0</graphql.java.version>
<graphql.java.annotations.version>8.0</graphql.java.annotations.version>
<graphql.java.extended.scalars.version>1.0</graphql.java.extended.scalars.version>
<graphql.java.version>20.0</graphql.java.version>
<graphql.java.annotations.version>9.1</graphql.java.annotations.version>
<graphql.java.extended.scalars.version>20.0</graphql.java.extended.scalars.version>
<reactivex.version>2.2.19</reactivex.version>
<antlr.runtime.version>4.7.1</antlr.runtime.version>
<java.dataloader.version>2.2.0</java.dataloader.version>
<java.dataloader.version>3.2.0</java.dataloader.version>
<jetty.websocket.version>9.4.38.v20210224</jetty.websocket.version>
</properties>

Expand Down
10 changes: 10 additions & 0 deletions samples/graphql-providers-feature/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,16 @@
<artifactId>graphql-java-annotations</artifactId>
<version>${graphql.java.annotations.version}</version>
<scope>compile</scope>
<exclusions>
<exclusion>
<groupId>com.graphql-java</groupId>
<artifactId>graphql-java</artifactId>
</exclusion>
<exclusion>
<groupId>com.graphql-java</groupId>
<artifactId>graphql-java-extended-scalars</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>

Expand Down
Loading

0 comments on commit a5b5d72

Please sign in to comment.