Skip to content

(deps) Updating to latest graphql-java:17.1 library #272

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

Merged
merged 2 commits into from
Aug 20, 2021
Merged
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
4 changes: 3 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,9 @@ gradle.projectsEvaluated {

dependencies {
compile 'javax.validation:validation-api:1.1.0.Final'
compile 'com.graphql-java:graphql-java:16.2'
compile 'com.graphql-java:graphql-java:17.1'
compile 'com.graphql-java:graphql-java-extended-scalars:17.0'


// OSGi
compileOnly 'org.osgi:org.osgi.core:6.0.0'
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ org.gradle.daemon=true
org.gradle.parallel=true
org.gradle.jvmargs=-Dfile.encoding=UTF-8

version = 8.5
version = 9.0

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
*/
package graphql.annotations.dataFetchers;

import graphql.annotations.annotationTypes.GraphQLBatched;
import graphql.annotations.annotationTypes.GraphQLConstructor;
import graphql.annotations.annotationTypes.GraphQLInvokeDetached;
import graphql.annotations.annotationTypes.GraphQLName;
Expand Down Expand Up @@ -69,7 +68,7 @@ public T get(DataFetchingEnvironment environment) {
T obj;
if (Modifier.isStatic(method.getModifiers())) {
return (T) method.invoke(null, invocationArgs(environment, container));
} else if (method.isAnnotationPresent(GraphQLBatched.class) || method.isAnnotationPresent(GraphQLInvokeDetached.class)) {
} else if (method.isAnnotationPresent(GraphQLInvokeDetached.class)) {
obj = newInstance((Class<T>) method.getDeclaringClass());
} else if (!method.getDeclaringClass().isInstance(environment.getSource())) {
obj = newInstance((Class<T>) method.getDeclaringClass(), environment.getSource());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ private GraphQLDirective transformArgs(GraphQLDirective graphQLDirective, Annota

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

for (int i = argumentValues.length; i < arguments.size(); i++) {
int finalI = i;
directiveBuilder.argument(arguments.get(i).transform(builder -> builder.value(arguments.get(finalI).getDefaultValue())));
directiveBuilder.argument(arguments.get(i).transform(builder -> builder.value(arguments.get(finalI).getArgumentDefaultValue().getValue())));
}
return directiveBuilder.build();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,9 @@
*/
package graphql.annotations.processor.retrievers.fieldBuilders.method;

import graphql.annotations.annotationTypes.GraphQLBatched;
import graphql.annotations.annotationTypes.GraphQLDataFetcher;
import graphql.annotations.annotationTypes.GraphQLRelayMutation;
import graphql.annotations.connection.GraphQLConnection;
import graphql.annotations.dataFetchers.BatchedMethodDataFetcher;
import graphql.annotations.dataFetchers.MethodDataFetcher;
import graphql.annotations.dataFetchers.RelayMutationMethodDataFetcher;
import graphql.annotations.processor.ProcessingElementsContainer;
Expand Down Expand Up @@ -62,9 +60,7 @@ public MethodDataFetcherBuilder(Method method, GraphQLOutputType outputType, Typ
public DataFetcher build() {
GraphQLDataFetcher dataFetcher = method.getAnnotation(GraphQLDataFetcher.class);
DataFetcher actualDataFetcher;
if (dataFetcher == null && method.getAnnotation(GraphQLBatched.class) != null) {
actualDataFetcher = new BatchedMethodDataFetcher(method, typeFunction, container);
} else if (dataFetcher == null) {
if (dataFetcher == null) {
actualDataFetcher = new MethodDataFetcher(method, typeFunction, container);
} else {
actualDataFetcher = dataFetcherConstructor.constructDataFetcher(method.getName(), dataFetcher);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,8 @@
*/
package graphql.annotations.processor.retrievers.fieldBuilders.method;

import graphql.annotations.annotationTypes.GraphQLBatched;
import graphql.annotations.processor.ProcessingElementsContainer;
import graphql.annotations.processor.retrievers.fieldBuilders.Builder;
import graphql.annotations.processor.typeFunctions.BatchedTypeFunction;
import graphql.annotations.processor.typeFunctions.TypeFunction;
import graphql.schema.GraphQLOutputType;
import graphql.schema.GraphQLType;
Expand All @@ -42,14 +40,7 @@ public MethodTypeBuilder(Method method, TypeFunction typeFunction, ProcessingEle
public GraphQLType build() {
AnnotatedType annotatedReturnType = method.getAnnotatedReturnType();

TypeFunction typeFunction;
if (method.getAnnotation(GraphQLBatched.class) != null) {
typeFunction = new BatchedTypeFunction(this.typeFunction);
} else {
typeFunction = this.typeFunction;
}

return typeFunction.buildType(isInput,method.getReturnType(), annotatedReturnType, container);
return this.typeFunction.buildType(isInput,method.getReturnType(), annotatedReturnType, container);
}

}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,16 @@
*/
package graphql.annotations.processor.typeFunctions;

import graphql.Scalars;
import graphql.annotations.processor.ProcessingElementsContainer;
import graphql.scalars.ExtendedScalars;
import graphql.schema.GraphQLType;

import java.lang.reflect.AnnotatedType;
import java.math.BigDecimal;

public class BigDecimalFunction implements TypeFunction {
@Override
public String getTypeName(Class<?> aClass, AnnotatedType annotatedType) {
return Scalars.GraphQLBigDecimal.getName();
return ExtendedScalars.GraphQLBigDecimal.getName();
}

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

private GraphQLType buildType(boolean inputType, Class<?> aClass, AnnotatedType annotatedType) {
return Scalars.GraphQLBigDecimal;
return ExtendedScalars.GraphQLBigDecimal;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,16 @@
*/
package graphql.annotations.processor.typeFunctions;

import graphql.Scalars;
import graphql.annotations.processor.ProcessingElementsContainer;
import graphql.scalars.ExtendedScalars;
import graphql.schema.GraphQLType;

import java.lang.reflect.AnnotatedType;
import java.math.BigInteger;

public class BigIntegerFunction implements TypeFunction {
@Override
public String getTypeName(Class<?> aClass, AnnotatedType annotatedType) {
return Scalars.GraphQLBigInteger.getName();
return ExtendedScalars.GraphQLBigInteger.getName();
}

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

private GraphQLType buildType(boolean inputType, Class<?> aClass, AnnotatedType annotatedType) {
return Scalars.GraphQLBigInteger;
return ExtendedScalars.GraphQLBigInteger;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,15 @@
*/
package graphql.annotations.processor.typeFunctions;

import graphql.Scalars;
import graphql.annotations.processor.ProcessingElementsContainer;
import graphql.scalars.ExtendedScalars;
import graphql.schema.GraphQLType;

import java.lang.reflect.AnnotatedType;

public class ByteFunction implements TypeFunction {
@Override
public String getTypeName(Class<?> aClass, AnnotatedType annotatedType) {
return Scalars.GraphQLByte.getName();
return ExtendedScalars.GraphQLByte.getName();
}

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

private GraphQLType buildType(boolean inputType, Class<?> aClass, AnnotatedType annotatedType) {
return Scalars.GraphQLByte;
return ExtendedScalars.GraphQLByte;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,16 @@
*/
package graphql.annotations.processor.typeFunctions;

import graphql.Scalars;
import graphql.annotations.processor.ProcessingElementsContainer;
import graphql.scalars.ExtendedScalars;
import graphql.schema.GraphQLType;

import java.lang.reflect.AnnotatedType;

public class CharFunction implements TypeFunction {

@Override
public String getTypeName(Class<?> aClass, AnnotatedType annotatedType) {
return Scalars.GraphQLChar.getName();
return ExtendedScalars.GraphQLChar.getName();
}

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

private GraphQLType buildType(boolean inputType, Class<?> aClass, AnnotatedType annotatedType) {
return Scalars.GraphQLChar;
return ExtendedScalars.GraphQLChar;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,6 @@ public void activate() {
typeFunctions.add(new BooleanFunction());
typeFunctions.add(new FloatFunction());
typeFunctions.add(new IntegerFunction());
typeFunctions.add(new LongFunction());
typeFunctions.add(new ByteFunction());
typeFunctions.add(new ShortFunction());
typeFunctions.add(new BigIntegerFunction());
typeFunctions.add(new BigDecimalFunction());
typeFunctions.add(new CharFunction());
typeFunctions.add(new IterableFunction(DefaultTypeFunction.this));
typeFunctions.add(new ArrayFunction(DefaultTypeFunction.this));
typeFunctions.add(new StreamFunction(DefaultTypeFunction.this));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,17 @@
*/
package graphql.annotations.processor.typeFunctions;

import graphql.Scalars;
import graphql.annotations.processor.ProcessingElementsContainer;
import graphql.scalars.ExtendedScalars;
import graphql.schema.GraphQLType;

import java.lang.reflect.AnnotatedType;


class LongFunction implements TypeFunction {

@Override
public String getTypeName(Class<?> aClass, AnnotatedType annotatedType) {
return Scalars.GraphQLLong.getName();
return ExtendedScalars.GraphQLLong.getName();
}

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

private GraphQLType buildType(boolean inputType, Class<?> aClass, AnnotatedType annotatedType) {
return Scalars.GraphQLLong;
return ExtendedScalars.GraphQLLong;
}

}
Loading