Skip to content

Commit b14bb1b

Browse files
author
Thomas Draier
committed
Renamed variable to avoid local override
1 parent 6445434 commit b14bb1b

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/main/java/graphql/annotations/GraphQLAnnotations.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -563,7 +563,7 @@ protected GraphQLFieldDefinition getField(Method method) throws GraphQLAnnotatio
563563
return getArgument(parameter, graphQLType);
564564
}).collect(Collectors.toList());
565565

566-
GraphQLFieldDefinition relay = null;
566+
GraphQLFieldDefinition relayFieldDefinition = null;
567567
if (method.isAnnotationPresent(GraphQLRelayMutation.class)) {
568568
if (!(outputType instanceof GraphQLObjectType || outputType instanceof GraphQLInterfaceType)) {
569569
throw new RuntimeException("outputType should be an object or an interface");
@@ -574,12 +574,12 @@ protected GraphQLFieldDefinition getField(Method method) throws GraphQLAnnotatio
574574
List<GraphQLFieldDefinition> fieldDefinitions = outputType instanceof GraphQLObjectType ?
575575
((GraphQLObjectType) outputType).getFieldDefinitions() :
576576
((GraphQLInterfaceType) outputType).getFieldDefinitions();
577-
relay = GraphQLAnnotations.this.relay.mutationWithClientMutationId(title, method.getName(),
577+
relayFieldDefinition = relay.mutationWithClientMutationId(title, method.getName(),
578578
args.stream().
579579
map(t -> newInputObjectField().name(t.getName()).type(t.getType()).description(t.getDescription()).build()).
580580
collect(Collectors.toList()), fieldDefinitions, null);
581-
builder.argument(relay.getArguments());
582-
builder.type(relay.getType());
581+
builder.argument(relayFieldDefinition.getArguments());
582+
builder.type(relayFieldDefinition.getType());
583583
} else {
584584
builder.argument(args);
585585
}
@@ -607,8 +607,8 @@ protected GraphQLFieldDefinition getField(Method method) throws GraphQLAnnotatio
607607
actualDataFetcher = constructDataFetcher(method.getName(), dataFetcher);
608608
}
609609

610-
if (method.isAnnotationPresent(GraphQLRelayMutation.class) && relay != null) {
611-
actualDataFetcher = new RelayMutationMethodDataFetcher(method, args, relay.getArgument("input").getType(), relay.getType());
610+
if (method.isAnnotationPresent(GraphQLRelayMutation.class) && relayFieldDefinition != null) {
611+
actualDataFetcher = new RelayMutationMethodDataFetcher(method, args, relayFieldDefinition.getArgument("input").getType(), relayFieldDefinition.getType());
612612
}
613613

614614
if (isConnection) {

0 commit comments

Comments
 (0)