Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UNOMI-667: Upgrade GraphQL-Java & other dependencies to the latest versions #562

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions graphql/cxs-impl/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,28 @@
<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>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.graphql-java</groupId>
<artifactId>graphql-java-extended-scalars</artifactId>
<version>${graphql.java.extended.scalars.version}</version>
<exclusions>
<exclusion>
<groupId>com.graphql-java</groupId>
<artifactId>graphql-java</artifactId>
</exclusion>
</exclusions>
<scope>provided</scope>
</dependency>
<dependency>
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
20 changes: 18 additions & 2 deletions graphql/karaf-feature/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,12 @@
<dependency>
<groupId>org.antlr</groupId>
<artifactId>antlr4-runtime</artifactId>
<version>4.7.1</version>
<version>${antlr.runtime.version}</version>
</dependency>
<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,11 +78,27 @@
<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-extended-scalars</artifactId>
</exclusion>
<exclusion>
<groupId>com.graphql-java</groupId>
<artifactId>graphql-java</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.graphql-java</groupId>
<artifactId>graphql-java-extended-scalars</artifactId>
<version>${graphql.java.extended.scalars.version}</version>
<exclusions>
<exclusion>
<groupId>com.graphql-java</groupId>
<artifactId>graphql-java</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>io.reactivex.rxjava2</groupId>
Expand Down
2 changes: 1 addition & 1 deletion graphql/karaf-feature/src/main/feature/feature.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<bundle start-level="80">wrap:mvn:com.graphql-java/java-dataloader/${java.dataloader.version}</bundle>
<bundle start-level="80">mvn:org.reactivestreams/reactive-streams/1.0.2</bundle>
<bundle start-level="80">mvn:com.graphql-java/graphql-java/${graphql.java.version}</bundle>
<bundle start-level="80">mvn:io.github.graphql-java/graphql-java-annotations/${graphql.java.annotations.version}</bundle>
<bundle start-level="80">wrap:mvn:io.github.graphql-java/graphql-java-annotations/${graphql.java.annotations.version}</bundle>
<bundle start-level="80">mvn:javax.validation/validation-api/${bean.validation.version}</bundle>
<bundle start-level="80">wrap:mvn:com.graphql-java/graphql-java-extended-scalars/${graphql.java.extended.scalars.version}</bundle>
<bundle start-level="80">wrap:mvn:com.squareup.okhttp3/okhttp/3.2.0</bundle>
Expand Down
Loading