Skip to content

Commit d755034

Browse files
committed
Merge branch '1.4.x'
2 parents 1a6519d + a5c25b8 commit d755034

File tree

4 files changed

+16
-3
lines changed

4 files changed

+16
-3
lines changed

.github/workflows/update-antora-ui-spring.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
name: Update on Supported Branches
1717
strategy:
1818
matrix:
19-
branch: [ '1.3.x', 'main' ]
19+
branch: [ '1.3.x', '1.4.x', 'main' ]
2020
steps:
2121
- uses: spring-io/spring-doc-actions/update-antora-spring-ui@e28269199d1d27975cf7f65e16d6095c555b3cd0 # v0.0.20
2222
name: Update

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,12 @@ public int hashCode() {
136136
return result;
137137
}
138138

139+
@Override
140+
public String toString() {
141+
String v = ((this.value != null) ? this.value.toString() : (this.omitted) ? "omitted" : "empty");
142+
return "ArgumentValue[" + v + "]";
143+
}
144+
139145

140146
/**
141147
* Static factory method for an argument value that was provided, even if

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,13 +158,14 @@ private void addParameters(
158158
@Nullable String prefix, Map<String, Object> arguments, MultiValueMap<String, Object> parameters) {
159159

160160
for (Map.Entry<String, Object> entry : arguments.entrySet()) {
161+
String key = ((prefix != null) ? prefix + "." : "") + entry.getKey();
161162
Object value = entry.getValue();
162163
if (value instanceof Map<?, ?> nested) {
163-
addParameters(entry.getKey(), (Map<String, Object>) nested, parameters);
164+
addParameters(key, (Map<String, Object>) nested, parameters);
164165
continue;
165166
}
166167
List<Object> values = (value instanceof List) ? (List<Object>) value : Collections.singletonList(value);
167-
parameters.put(((prefix != null) ? prefix + "." : "") + entry.getKey(), values);
168+
parameters.put(key, values);
168169
}
169170
}
170171

spring-graphql/src/test/java/org/springframework/graphql/data/ArgumentValueTests.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,4 +80,10 @@ void ifPresentShouldSkipWhenOmitted() {
8080
assertThat(called.get()).isFalse();
8181
}
8282

83+
@Test
84+
void toStringValue() {
85+
assertThat(ArgumentValue.omitted()).hasToString("ArgumentValue[omitted]");
86+
assertThat(ArgumentValue.ofNullable(null)).hasToString("ArgumentValue[empty]");
87+
assertThat(ArgumentValue.ofNullable("hello")).hasToString("ArgumentValue[hello]");
88+
}
8389
}

0 commit comments

Comments
 (0)