Skip to content

Gql java 17.1 - Version 9.0 #278

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 5 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
5 changes: 1 addition & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@

name: Build

on: [push]
on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-latest
environment: prod
steps:
- uses: actions/checkout@v2
- name: Set up JDK 8
Expand All @@ -20,8 +19,6 @@ jobs:
run: chmod +x gradlew
- name: Build with Gradle
run: ./gradlew build
- name: Test with Gradle
run: ./gradlew test
- name: Publish Test Report
uses: mikepenz/action-junit-report@v2
if: always() # always run even if the previous step fails
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ If you would like to use a tool that creates a graphql spring boot server using

```groovy
dependencies {
compile "io.github.graphql-java:graphql-java-annotations:8.5"
compile "io.github.graphql-java:graphql-java-annotations:9.0"
}
```

Expand All @@ -47,7 +47,7 @@ dependencies {
<dependency>
<groupId>io.github.graphql-java</groupId>
<artifactId>graphql-java-annotations</artifactId>
<version>8.5</version>
<version>9.0</version>
</dependency>
```

Expand Down
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;
}
}
Loading