Skip to content
Prev Previous commit
Next Next commit
Migrate to graphql-java 16.1
  • Loading branch information
BURJA Lucian committed Dec 2, 2020
commit 43713f6e9d43bdc2794e505ea55759473ede1857
13 changes: 12 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,25 @@
<kotlin.version>1.3.72</kotlin.version>
<kotlin-coroutines.version>1.3.9</kotlin-coroutines.version>
<jackson.version>2.10.3</jackson.version>
<graphql-java.version>15.0</graphql-java.version>
<graphql-java.version>16.1</graphql-java.version>

<maven.compiler.source>${java.version}</maven.compiler.source>
<maven.compiler.target>${java.version}</maven.compiler.target>
<useReleaseProfile>false</useReleaseProfile>
<project.scm.id>github</project.scm.id>
</properties>

<dependencyManagement>
<dependencies>
<!-- graphql-java defines this dependency as 'runtime', but we need it at compile time -->
<dependency>
<groupId>org.antlr</groupId>
<artifactId>antlr4-runtime</artifactId>
<scope>compile</scope>
</dependency>
</dependencies>
</dependencyManagement>

<dependencies>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
Expand Down
6 changes: 3 additions & 3 deletions src/main/kotlin/graphql/kickstart/tools/SchemaParser.kt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import graphql.language.*
import graphql.schema.*
import graphql.schema.idl.RuntimeWiring
import graphql.schema.idl.ScalarInfo
import graphql.schema.idl.SchemaGeneratorHelper
import graphql.schema.idl.SchemaGeneratorHelperExt
import graphql.schema.visibility.NoIntrospectionGraphqlFieldVisibility
import org.slf4j.LoggerFactory
import kotlin.reflect.KClass
Expand Down Expand Up @@ -58,7 +58,7 @@ class SchemaParser internal constructor(

private val codeRegistryBuilder = GraphQLCodeRegistry.newCodeRegistry()

private val schemaGeneratorHelper = SchemaGeneratorHelper()
private val schemaGeneratorHelper = SchemaGeneratorHelperExt()
private val schemaGeneratorDirectiveHelper = SchemaGeneratorDirectiveHelper()
private val schemaDirectiveParameters = SchemaGeneratorDirectiveHelper.Parameters(null, runtimeWiring, null, codeRegistryBuilder)

Expand Down Expand Up @@ -311,7 +311,7 @@ class SchemaParser internal constructor(
.build()


output.add(schemaGeneratorHelper.buildDirective(directive, setOf(graphQLDirective), directiveLocation, runtimeWiring.comparatorRegistry))
output.add(schemaGeneratorHelper.buildDirective(directive, graphQLDirective, directiveLocation, runtimeWiring.comparatorRegistry))
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,14 @@
import graphql.Internal;
import graphql.language.NamedNode;
import graphql.language.NodeParentTree;
import graphql.schema.*;
import graphql.schema.DataFetcher;
import graphql.schema.FieldCoordinates;
import graphql.schema.GraphQLCodeRegistry;
import graphql.schema.GraphQLDirective;
import graphql.schema.GraphQLDirectiveContainer;
import graphql.schema.GraphQLFieldDefinition;
import graphql.schema.GraphQLFieldsContainer;
import graphql.schema.GraphqlElementParentTree;
import graphql.schema.idl.SchemaDirectiveWiringEnvironment;
import graphql.schema.idl.TypeDefinitionRegistry;
import graphql.util.FpKit;
Expand All @@ -17,14 +24,14 @@
/*
* DO NOT EDIT THIS FILE!
*
* File copied from com.graphql-java.graphql-java:15.0 without any changes.
* File copied from com.graphql-java.graphql-java:16.1 without any changes.
*/
@Internal
public class SchemaDirectiveWiringEnvironmentImpl<T extends GraphQLDirectiveContainer> implements SchemaDirectiveWiringEnvironment<T> {

private final T element;
private final Map<String, GraphQLDirective> directives;
private final NodeParentTree<NamedNode> nodeParentTree;
private final NodeParentTree<NamedNode<?>> nodeParentTree;
private final TypeDefinitionRegistry typeDefinitionRegistry;
private final Map<String, Object> context;
private final GraphQLCodeRegistry.Builder codeRegistry;
Expand All @@ -33,12 +40,7 @@ public class SchemaDirectiveWiringEnvironmentImpl<T extends GraphQLDirectiveCont
private final GraphQLFieldDefinition fieldDefinition;
private final GraphQLDirective registeredDirective;

public SchemaDirectiveWiringEnvironmentImpl(
T element,
List<GraphQLDirective> directives,
GraphQLDirective registeredDirective,
SchemaGeneratorDirectiveHelper.Parameters parameters
) {
public SchemaDirectiveWiringEnvironmentImpl(T element, List<GraphQLDirective> directives, GraphQLDirective registeredDirective, SchemaGeneratorDirectiveHelper.Parameters parameters) {
this.element = element;
this.registeredDirective = registeredDirective;
this.typeDefinitionRegistry = parameters.getTypeRegistry();
Expand Down Expand Up @@ -77,7 +79,7 @@ public boolean containsDirective(String directiveName) {
}

@Override
public NodeParentTree<NamedNode> getNodeParentTree() {
public NodeParentTree<NamedNode<?>> getNodeParentTree() {
return nodeParentTree;
}

Expand Down Expand Up @@ -112,14 +114,14 @@ public GraphQLFieldDefinition getFieldDefinition() {
}

@Override
public DataFetcher getFieldDataFetcher() {
public DataFetcher<?> getFieldDataFetcher() {
assertNotNull(fieldDefinition, () -> "An output field must be in context to call this method");
assertNotNull(fieldsContainer, () -> "An output field container must be in context to call this method");
return codeRegistry.getDataFetcher(fieldsContainer, fieldDefinition);
}

@Override
public GraphQLFieldDefinition setFieldDataFetcher(DataFetcher newDataFetcher) {
public GraphQLFieldDefinition setFieldDataFetcher(DataFetcher<?> newDataFetcher) {
assertNotNull(fieldDefinition, () -> "An output field must be in context to call this method");
assertNotNull(fieldsContainer, () -> "An output field container must be in context to call this method");

Expand Down
Loading