Skip to content

Commit fc1e05b

Browse files
committed
Fix variable names following recent rename
1 parent 7e43223 commit fc1e05b

File tree

6 files changed

+25
-24
lines changed

6 files changed

+25
-24
lines changed

spring-graphql/src/main/java/org/springframework/graphql/data/GraphQlArgumentBinder.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,11 @@
4848

4949

5050
/**
51-
* Bind a GraphQL argument values to higher level objects.
51+
* Bind a GraphQL argument, or the full arguments map, onto a target object.
5252
*
5353
* <p>Binding is performed by mapping argument values to a primary data
54-
* constructor of the target Object, or by using a default constructor
55-
* and mapping argument values to properties. This is applied recursively.
54+
* constructor of the target object, or by using a default constructor and
55+
* mapping argument values to its properties. This is applied recursively.
5656
*
5757
* @author Brian Clozel
5858
* @author Rossen Stoyanchev
@@ -93,18 +93,18 @@ private ConversionService getConversionService() {
9393

9494

9595
/**
96-
* Bind a single argument or the full arguments map onto an object of the
96+
* Bind a single argument, or the full arguments map, onto an object of the
9797
* given target type.
98-
* @param environment to obtain the argument value(s) from
98+
* @param environment for access to the arguments
9999
* @param argumentName the name of the argument to bind, or {@code null} to
100100
* use the full arguments map
101101
* @param targetType the type of Object to create
102102
* @return the created Object, possibly {@code null}
103103
* @throws BindException in case of binding issues such as conversion errors,
104104
* mismatches between the source and the target object structure, and so on.
105105
* Binding issues are accumulated as {@link BindException#getFieldErrors()
106-
* field errors} where the {@code field} of each error is the argument path
107-
* where the issue occurred.
106+
* field errors} where the {@link FieldError#getField() field} of each error
107+
* is the argument path where the issue occurred.
108108
*/
109109
@Nullable
110110
@SuppressWarnings("unchecked")

spring-graphql/src/main/java/org/springframework/graphql/data/method/annotation/support/AnnotatedControllerConfigurer.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -159,9 +159,9 @@ public void afterPropertiesSet() {
159159
this.argumentResolvers.addResolver(new ProjectedPayloadMethodArgumentResolver(obtainApplicationContext()));
160160
}
161161
this.argumentResolvers.addResolver(new ArgumentMapMethodArgumentResolver());
162-
GraphQlArgumentBinder initializer = new GraphQlArgumentBinder(this.conversionService);
163-
this.argumentResolvers.addResolver(new ArgumentMethodArgumentResolver(initializer));
164-
this.argumentResolvers.addResolver(new ArgumentsMethodArgumentResolver(initializer));
162+
GraphQlArgumentBinder argumentBinder = new GraphQlArgumentBinder(this.conversionService);
163+
this.argumentResolvers.addResolver(new ArgumentMethodArgumentResolver(argumentBinder));
164+
this.argumentResolvers.addResolver(new ArgumentsMethodArgumentResolver(argumentBinder));
165165
this.argumentResolvers.addResolver(new ContextValueMethodArgumentResolver());
166166

167167
// Type based

spring-graphql/src/main/java/org/springframework/graphql/data/method/annotation/support/ArgumentMethodArgumentResolver.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,12 @@
3737
*/
3838
public class ArgumentMethodArgumentResolver implements HandlerMethodArgumentResolver {
3939

40-
private final GraphQlArgumentBinder argumentInitializer;
40+
private final GraphQlArgumentBinder argumentBinder;
4141

4242

43-
public ArgumentMethodArgumentResolver(GraphQlArgumentBinder initializer) {
44-
Assert.notNull(initializer, "GraphQlArgumentInitializer is required");
45-
this.argumentInitializer = initializer;
43+
public ArgumentMethodArgumentResolver(GraphQlArgumentBinder argumentBinder) {
44+
Assert.notNull(argumentBinder, "GraphQlArgumentBinder is required");
45+
this.argumentBinder = argumentBinder;
4646
}
4747

4848

@@ -55,7 +55,7 @@ public boolean supportsParameter(MethodParameter parameter) {
5555
public Object resolveArgument(MethodParameter parameter, DataFetchingEnvironment environment) throws Exception {
5656
String name = getArgumentName(parameter);
5757
ResolvableType resolvableType = ResolvableType.forMethodParameter(parameter);
58-
return this.argumentInitializer.bind(environment, name, resolvableType);
58+
return this.argumentBinder.bind(environment, name, resolvableType);
5959
}
6060

6161
static String getArgumentName(MethodParameter parameter) {

spring-graphql/src/main/java/org/springframework/graphql/data/method/annotation/support/ArgumentsMethodArgumentResolver.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,12 @@
3434
*/
3535
public class ArgumentsMethodArgumentResolver implements HandlerMethodArgumentResolver {
3636

37-
private final GraphQlArgumentBinder argumentInitializer;
37+
private final GraphQlArgumentBinder argumentBinder;
3838

3939

40-
public ArgumentsMethodArgumentResolver(GraphQlArgumentBinder initializer) {
41-
Assert.notNull(initializer, "GraphQlArgumentInitializer is required");
42-
this.argumentInitializer = initializer;
40+
public ArgumentsMethodArgumentResolver(GraphQlArgumentBinder argumentBinder) {
41+
Assert.notNull(argumentBinder, "GraphQlArgumentBinder is required");
42+
this.argumentBinder = argumentBinder;
4343
}
4444

4545

@@ -51,7 +51,7 @@ public boolean supportsParameter(MethodParameter parameter) {
5151
@Override
5252
public Object resolveArgument(MethodParameter parameter, DataFetchingEnvironment environment) throws Exception {
5353
ResolvableType resolvableType = ResolvableType.forMethodParameter(parameter);
54-
return this.argumentInitializer.bind(environment, null, resolvableType);
54+
return this.argumentBinder.bind(environment, null, resolvableType);
5555
}
5656

5757
}

spring-graphql/src/main/java/org/springframework/graphql/data/query/QueryByExampleDataFetcher.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,12 +92,12 @@ public abstract class QueryByExampleDataFetcher<T> {
9292

9393
private final TypeInformation<T> domainType;
9494

95-
private final GraphQlArgumentBinder argumentInitializer;
95+
private final GraphQlArgumentBinder argumentBinder;
9696

9797

9898
QueryByExampleDataFetcher(TypeInformation<T> domainType) {
9999
this.domainType = domainType;
100-
this.argumentInitializer = new GraphQlArgumentBinder();
100+
this.argumentBinder = new GraphQlArgumentBinder();
101101
}
102102

103103

@@ -109,7 +109,7 @@ public abstract class QueryByExampleDataFetcher<T> {
109109
@SuppressWarnings({"ConstantConditions", "unchecked"})
110110
protected Example<T> buildExample(DataFetchingEnvironment env) throws BindException {
111111
ResolvableType targetType = ResolvableType.forClass(this.domainType.getType());
112-
return (Example<T>) Example.of(this.argumentInitializer.bind(env, null, targetType));
112+
return (Example<T>) Example.of(this.argumentBinder.bind(env, null, targetType));
113113
}
114114

115115
protected boolean requiresProjection(Class<?> resultType) {

spring-graphql/src/test/java/org/springframework/graphql/data/method/annotation/support/GraphQlArgumentBinderTests.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ class GraphQlArgumentBinderTests {
4545

4646
private final ObjectMapper mapper = new ObjectMapper();
4747

48-
private final ThreadLocal<GraphQlArgumentBinder> initializer = ThreadLocal.withInitial(() -> new GraphQlArgumentBinder(null));
48+
private final ThreadLocal<GraphQlArgumentBinder> initializer =
49+
ThreadLocal.withInitial(() -> new GraphQlArgumentBinder(null));
4950

5051

5152
@Test

0 commit comments

Comments
 (0)