Skip to content

Commit eef0f4c

Browse files
authored
Merge pull request #272 from setchy/feature/graphql-java-17
(deps) Updating to latest graphql-java:17.1 library
2 parents db974fd + abd33e3 commit eef0f4c

30 files changed

+83
-353
lines changed

build.gradle

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,9 @@ gradle.projectsEvaluated {
5454

5555
dependencies {
5656
compile 'javax.validation:validation-api:1.1.0.Final'
57-
compile 'com.graphql-java:graphql-java:16.2'
57+
compile 'com.graphql-java:graphql-java:17.1'
58+
compile 'com.graphql-java:graphql-java-extended-scalars:17.0'
59+
5860

5961
// OSGi
6062
compileOnly 'org.osgi:org.osgi.core:6.0.0'

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ org.gradle.daemon=true
55
org.gradle.parallel=true
66
org.gradle.jvmargs=-Dfile.encoding=UTF-8
77

8-
version = 8.5
8+
version = 9.0

src/main/java/graphql/annotations/annotationTypes/GraphQLBatched.java

Lines changed: 0 additions & 25 deletions
This file was deleted.

src/main/java/graphql/annotations/dataFetchers/BatchedMethodDataFetcher.java

Lines changed: 0 additions & 40 deletions
This file was deleted.

src/main/java/graphql/annotations/dataFetchers/MethodDataFetcher.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
*/
1313
package graphql.annotations.dataFetchers;
1414

15-
import graphql.annotations.annotationTypes.GraphQLBatched;
1615
import graphql.annotations.annotationTypes.GraphQLConstructor;
1716
import graphql.annotations.annotationTypes.GraphQLInvokeDetached;
1817
import graphql.annotations.annotationTypes.GraphQLName;
@@ -69,7 +68,7 @@ public T get(DataFetchingEnvironment environment) {
6968
T obj;
7069
if (Modifier.isStatic(method.getModifiers())) {
7170
return (T) method.invoke(null, invocationArgs(environment, container));
72-
} else if (method.isAnnotationPresent(GraphQLBatched.class) || method.isAnnotationPresent(GraphQLInvokeDetached.class)) {
71+
} else if (method.isAnnotationPresent(GraphQLInvokeDetached.class)) {
7372
obj = newInstance((Class<T>) method.getDeclaringClass());
7473
} else if (!method.getDeclaringClass().isInstance(environment.getSource())) {
7574
obj = newInstance((Class<T>) method.getDeclaringClass(), environment.getSource());

src/main/java/graphql/annotations/processor/retrievers/fieldBuilders/DirectivesBuilder.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ private GraphQLDirective transformArgs(GraphQLDirective graphQLDirective, Annota
9797

9898
for (int i = annotation.annotationType().getDeclaredMethods().length; i < arguments.size(); i++) {
9999
int finalI = i;
100-
directiveBuilder.argument(arguments.get(i).transform(builder -> builder.value(arguments.get(finalI).getDefaultValue())));
100+
directiveBuilder.argument(arguments.get(i).transform(builder -> builder.value(arguments.get(finalI).getArgumentDefaultValue().getValue())));
101101
}
102102
return directiveBuilder.build();
103103
}
@@ -118,7 +118,7 @@ private GraphQLDirective transformArgs(GraphQLDirective graphQLDirective, String
118118

119119
for (int i = argumentValues.length; i < arguments.size(); i++) {
120120
int finalI = i;
121-
directiveBuilder.argument(arguments.get(i).transform(builder -> builder.value(arguments.get(finalI).getDefaultValue())));
121+
directiveBuilder.argument(arguments.get(i).transform(builder -> builder.value(arguments.get(finalI).getArgumentDefaultValue().getValue())));
122122
}
123123
return directiveBuilder.build();
124124
}

src/main/java/graphql/annotations/processor/retrievers/fieldBuilders/method/MethodDataFetcherBuilder.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,9 @@
1414
*/
1515
package graphql.annotations.processor.retrievers.fieldBuilders.method;
1616

17-
import graphql.annotations.annotationTypes.GraphQLBatched;
1817
import graphql.annotations.annotationTypes.GraphQLDataFetcher;
1918
import graphql.annotations.annotationTypes.GraphQLRelayMutation;
2019
import graphql.annotations.connection.GraphQLConnection;
21-
import graphql.annotations.dataFetchers.BatchedMethodDataFetcher;
2220
import graphql.annotations.dataFetchers.MethodDataFetcher;
2321
import graphql.annotations.dataFetchers.RelayMutationMethodDataFetcher;
2422
import graphql.annotations.processor.ProcessingElementsContainer;
@@ -62,9 +60,7 @@ public MethodDataFetcherBuilder(Method method, GraphQLOutputType outputType, Typ
6260
public DataFetcher build() {
6361
GraphQLDataFetcher dataFetcher = method.getAnnotation(GraphQLDataFetcher.class);
6462
DataFetcher actualDataFetcher;
65-
if (dataFetcher == null && method.getAnnotation(GraphQLBatched.class) != null) {
66-
actualDataFetcher = new BatchedMethodDataFetcher(method, typeFunction, container);
67-
} else if (dataFetcher == null) {
63+
if (dataFetcher == null) {
6864
actualDataFetcher = new MethodDataFetcher(method, typeFunction, container);
6965
} else {
7066
actualDataFetcher = dataFetcherConstructor.constructDataFetcher(method.getName(), dataFetcher);

src/main/java/graphql/annotations/processor/retrievers/fieldBuilders/method/MethodTypeBuilder.java

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,8 @@
1414
*/
1515
package graphql.annotations.processor.retrievers.fieldBuilders.method;
1616

17-
import graphql.annotations.annotationTypes.GraphQLBatched;
1817
import graphql.annotations.processor.ProcessingElementsContainer;
1918
import graphql.annotations.processor.retrievers.fieldBuilders.Builder;
20-
import graphql.annotations.processor.typeFunctions.BatchedTypeFunction;
2119
import graphql.annotations.processor.typeFunctions.TypeFunction;
2220
import graphql.schema.GraphQLOutputType;
2321
import graphql.schema.GraphQLType;
@@ -42,14 +40,7 @@ public MethodTypeBuilder(Method method, TypeFunction typeFunction, ProcessingEle
4240
public GraphQLType build() {
4341
AnnotatedType annotatedReturnType = method.getAnnotatedReturnType();
4442

45-
TypeFunction typeFunction;
46-
if (method.getAnnotation(GraphQLBatched.class) != null) {
47-
typeFunction = new BatchedTypeFunction(this.typeFunction);
48-
} else {
49-
typeFunction = this.typeFunction;
50-
}
51-
52-
return typeFunction.buildType(isInput,method.getReturnType(), annotatedReturnType, container);
43+
return this.typeFunction.buildType(isInput,method.getReturnType(), annotatedReturnType, container);
5344
}
5445

5546
}

src/main/java/graphql/annotations/processor/typeFunctions/BatchedTypeFunction.java

Lines changed: 0 additions & 60 deletions
This file was deleted.

src/main/java/graphql/annotations/processor/typeFunctions/BigDecimalFunction.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,16 @@
1414
*/
1515
package graphql.annotations.processor.typeFunctions;
1616

17-
import graphql.Scalars;
1817
import graphql.annotations.processor.ProcessingElementsContainer;
18+
import graphql.scalars.ExtendedScalars;
1919
import graphql.schema.GraphQLType;
20-
2120
import java.lang.reflect.AnnotatedType;
2221
import java.math.BigDecimal;
2322

2423
public class BigDecimalFunction implements TypeFunction {
2524
@Override
2625
public String getTypeName(Class<?> aClass, AnnotatedType annotatedType) {
27-
return Scalars.GraphQLBigDecimal.getName();
26+
return ExtendedScalars.GraphQLBigDecimal.getName();
2827
}
2928

3029
@Override
@@ -38,6 +37,6 @@ public GraphQLType buildType(boolean input, Class<?> aClass, AnnotatedType annot
3837
}
3938

4039
private GraphQLType buildType(boolean inputType, Class<?> aClass, AnnotatedType annotatedType) {
41-
return Scalars.GraphQLBigDecimal;
40+
return ExtendedScalars.GraphQLBigDecimal;
4241
}
4342
}

src/main/java/graphql/annotations/processor/typeFunctions/BigIntegerFunction.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,16 @@
1414
*/
1515
package graphql.annotations.processor.typeFunctions;
1616

17-
import graphql.Scalars;
1817
import graphql.annotations.processor.ProcessingElementsContainer;
18+
import graphql.scalars.ExtendedScalars;
1919
import graphql.schema.GraphQLType;
20-
2120
import java.lang.reflect.AnnotatedType;
2221
import java.math.BigInteger;
2322

2423
public class BigIntegerFunction implements TypeFunction {
2524
@Override
2625
public String getTypeName(Class<?> aClass, AnnotatedType annotatedType) {
27-
return Scalars.GraphQLBigInteger.getName();
26+
return ExtendedScalars.GraphQLBigInteger.getName();
2827
}
2928

3029
@Override
@@ -38,6 +37,6 @@ public GraphQLType buildType(boolean input, Class<?> aClass, AnnotatedType annot
3837
}
3938

4039
private GraphQLType buildType(boolean inputType, Class<?> aClass, AnnotatedType annotatedType) {
41-
return Scalars.GraphQLBigInteger;
40+
return ExtendedScalars.GraphQLBigInteger;
4241
}
4342
}

src/main/java/graphql/annotations/processor/typeFunctions/ByteFunction.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,15 @@
1414
*/
1515
package graphql.annotations.processor.typeFunctions;
1616

17-
import graphql.Scalars;
1817
import graphql.annotations.processor.ProcessingElementsContainer;
18+
import graphql.scalars.ExtendedScalars;
1919
import graphql.schema.GraphQLType;
20-
2120
import java.lang.reflect.AnnotatedType;
2221

2322
public class ByteFunction implements TypeFunction {
2423
@Override
2524
public String getTypeName(Class<?> aClass, AnnotatedType annotatedType) {
26-
return Scalars.GraphQLByte.getName();
25+
return ExtendedScalars.GraphQLByte.getName();
2726
}
2827

2928
@Override
@@ -37,6 +36,6 @@ public GraphQLType buildType(boolean input, Class<?> aClass, AnnotatedType annot
3736
}
3837

3938
private GraphQLType buildType(boolean inputType, Class<?> aClass, AnnotatedType annotatedType) {
40-
return Scalars.GraphQLByte;
39+
return ExtendedScalars.GraphQLByte;
4140
}
4241
}

src/main/java/graphql/annotations/processor/typeFunctions/CharFunction.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,16 @@
1414
*/
1515
package graphql.annotations.processor.typeFunctions;
1616

17-
import graphql.Scalars;
1817
import graphql.annotations.processor.ProcessingElementsContainer;
18+
import graphql.scalars.ExtendedScalars;
1919
import graphql.schema.GraphQLType;
20-
2120
import java.lang.reflect.AnnotatedType;
2221

2322
public class CharFunction implements TypeFunction {
2423

2524
@Override
2625
public String getTypeName(Class<?> aClass, AnnotatedType annotatedType) {
27-
return Scalars.GraphQLChar.getName();
26+
return ExtendedScalars.GraphQLChar.getName();
2827
}
2928

3029
@Override
@@ -38,6 +37,6 @@ public GraphQLType buildType(boolean input, Class<?> aClass, AnnotatedType annot
3837
}
3938

4039
private GraphQLType buildType(boolean inputType, Class<?> aClass, AnnotatedType annotatedType) {
41-
return Scalars.GraphQLChar;
40+
return ExtendedScalars.GraphQLChar;
4241
}
4342
}

src/main/java/graphql/annotations/processor/typeFunctions/DefaultTypeFunction.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,6 @@ public void activate() {
5555
typeFunctions.add(new BooleanFunction());
5656
typeFunctions.add(new FloatFunction());
5757
typeFunctions.add(new IntegerFunction());
58-
typeFunctions.add(new LongFunction());
59-
typeFunctions.add(new ByteFunction());
60-
typeFunctions.add(new ShortFunction());
61-
typeFunctions.add(new BigIntegerFunction());
62-
typeFunctions.add(new BigDecimalFunction());
63-
typeFunctions.add(new CharFunction());
6458
typeFunctions.add(new IterableFunction(DefaultTypeFunction.this));
6559
typeFunctions.add(new ArrayFunction(DefaultTypeFunction.this));
6660
typeFunctions.add(new StreamFunction(DefaultTypeFunction.this));

src/main/java/graphql/annotations/processor/typeFunctions/LongFunction.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,17 @@
1414
*/
1515
package graphql.annotations.processor.typeFunctions;
1616

17-
import graphql.Scalars;
1817
import graphql.annotations.processor.ProcessingElementsContainer;
18+
import graphql.scalars.ExtendedScalars;
1919
import graphql.schema.GraphQLType;
20-
2120
import java.lang.reflect.AnnotatedType;
2221

2322

2423
class LongFunction implements TypeFunction {
2524

2625
@Override
2726
public String getTypeName(Class<?> aClass, AnnotatedType annotatedType) {
28-
return Scalars.GraphQLLong.getName();
27+
return ExtendedScalars.GraphQLLong.getName();
2928
}
3029

3130
@Override
@@ -39,7 +38,7 @@ public GraphQLType buildType(boolean input, Class<?> aClass, AnnotatedType annot
3938
}
4039

4140
private GraphQLType buildType(boolean inputType, Class<?> aClass, AnnotatedType annotatedType) {
42-
return Scalars.GraphQLLong;
41+
return ExtendedScalars.GraphQLLong;
4342
}
4443

4544
}

0 commit comments

Comments
 (0)