Skip to content

Commit 584aa78

Browse files
committed
change dependency & fixed api changes
1 parent 7720bb2 commit 584aa78

File tree

3 files changed

+21
-19
lines changed

3 files changed

+21
-19
lines changed

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ gradle.projectsEvaluated {
9090

9191
dependencies {
9292
compile 'javax.validation:validation-api:1.1.0.Final'
93-
compile 'com.graphql-java:graphql-java:7.0'
93+
compile 'com.graphql-java:graphql-java:8.0'
9494

9595
// OSGi
9696
compileOnly 'org.osgi:org.osgi.core:6.0.0'

src/main/java/graphql/annotations/GraphQLFieldDefinitionWrapper.java

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
/**
22
* Copyright 2016 Yurii Rashkovskii
3-
*
3+
* <p>
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
66
* You may obtain a copy of the License at
7-
*
8-
* http://www.apache.org/licenses/LICENSE-2.0
9-
*
7+
* <p>
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
* <p>
1010
* Unless required by applicable law or agreed to in writing, software
1111
* distributed under the License is distributed on an "AS IS" BASIS,
1212
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -18,11 +18,13 @@
1818
import graphql.schema.DataFetcherFactories;
1919
import graphql.schema.GraphQLFieldDefinition;
2020

21-
public class GraphQLFieldDefinitionWrapper extends GraphQLFieldDefinition {
21+
public class GraphQLFieldDefinitionWrapper extends GraphQLFieldDefinition {
2222

2323
public GraphQLFieldDefinitionWrapper(GraphQLFieldDefinition fieldDefinition) {
2424
super(fieldDefinition.getName(), fieldDefinition.getDescription(), fieldDefinition.getType(),
25-
DataFetcherFactories.useDataFetcher((DataFetcher<?>)fieldDefinition.getDataFetcher()), fieldDefinition.getArguments(), fieldDefinition.getDeprecationReason(),
25+
DataFetcherFactories.useDataFetcher((DataFetcher<?>) fieldDefinition.getDataFetcher()),
26+
fieldDefinition.getArguments(), fieldDefinition.getDeprecationReason(),
27+
fieldDefinition.getDirectives(),
2628
fieldDefinition.getDefinition());
2729
}
2830

src/main/java/graphql/annotations/strategies/EnhancedExecutionStrategy.java

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ public class EnhancedExecutionStrategy extends AsyncSerialExecutionStrategy {
3131

3232
@Override
3333
protected CompletableFuture<ExecutionResult> resolveField(ExecutionContext executionContext, ExecutionStrategyParameters parameters) {
34-
GraphQLObjectType parentType = (GraphQLObjectType) parameters.typeInfo().getType();
35-
GraphQLFieldDefinition fieldDef = getFieldDef(executionContext.getGraphQLSchema(), parentType, parameters.field().get(0));
34+
GraphQLObjectType parentType = (GraphQLObjectType) parameters.getTypeInfo().getType();
35+
GraphQLFieldDefinition fieldDef = getFieldDef(executionContext.getGraphQLSchema(), parentType, parameters.getField().get(0));
3636
if (fieldDef == null) return null;
3737

3838
if (fieldDef.getName().contentEquals(CLIENT_MUTATION_ID)) {
@@ -52,11 +52,11 @@ protected CompletableFuture<ExecutionResult> resolveField(ExecutionContext execu
5252
clientMutationId = clientMutationIdVal.getValue();
5353
}
5454

55-
ExecutionTypeInfo fieldTypeInfo = ExecutionTypeInfo.newTypeInfo().type(fieldDef.getType()).parentInfo(parameters.typeInfo()).build();
55+
ExecutionTypeInfo fieldTypeInfo = ExecutionTypeInfo.newTypeInfo().type(fieldDef.getType()).parentInfo(parameters.getTypeInfo()).build();
5656
ExecutionStrategyParameters newParameters = ExecutionStrategyParameters.newParameters()
57-
.arguments(parameters.arguments())
58-
.fields(parameters.fields())
59-
.nonNullFieldValidator(parameters.nonNullFieldValidator())
57+
.arguments(parameters.getArguments())
58+
.fields(parameters.getFields())
59+
.nonNullFieldValidator(parameters.getNonNullFieldValidator())
6060
.typeInfo(fieldTypeInfo)
6161
.source(clientMutationId)
6262
.build();
@@ -70,8 +70,8 @@ protected CompletableFuture<ExecutionResult> resolveField(ExecutionContext execu
7070

7171
@Override
7272
protected CompletableFuture<ExecutionResult> completeValue(ExecutionContext executionContext, ExecutionStrategyParameters parameters) throws NonNullableFieldWasNullException {
73-
graphql.schema.GraphQLType fieldType = parameters.typeInfo().getType();
74-
Object result = parameters.source();
73+
graphql.schema.GraphQLType fieldType = parameters.getTypeInfo().getType();
74+
Object result = parameters.getSource();
7575
if (result instanceof Enum && fieldType instanceof GraphQLEnumType) {
7676
Object value = ((GraphQLEnumType) fieldType).getCoercing().parseValue(((Enum) result).name());
7777
return super.completeValue(executionContext, withSource(parameters, value));
@@ -88,10 +88,10 @@ protected CompletableFuture<ExecutionResult> completeValue(ExecutionContext exec
8888
*/
8989
private ExecutionStrategyParameters withSource(ExecutionStrategyParameters parameters, Object source) {
9090
return ExecutionStrategyParameters.newParameters()
91-
.arguments(parameters.arguments())
92-
.fields(parameters.fields())
93-
.nonNullFieldValidator(parameters.nonNullFieldValidator())
94-
.typeInfo(parameters.typeInfo())
91+
.arguments(parameters.getArguments())
92+
.fields(parameters.getFields())
93+
.nonNullFieldValidator(parameters.getNonNullFieldValidator())
94+
.typeInfo(parameters.getTypeInfo())
9595
.source(source)
9696
.build();
9797
}

0 commit comments

Comments
 (0)