Skip to content

Commit 6958e39

Browse files
committed
Fix isOmitted to return true for omitted arguments
Closes gh-553
1 parent 6119be9 commit 6958e39

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
*/
4747
public final class ArgumentValue<T> {
4848

49-
private static final ArgumentValue<?> OMITTED = new ArgumentValue<>(null, false);
49+
private static final ArgumentValue<?> OMITTED = new ArgumentValue<>(null, true);
5050

5151

5252
@Nullable

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -230,8 +230,8 @@ void primaryConstructorWithOptionalArgumentBeanArgument() throws Exception {
230230
itemBean = (PrimaryConstructorOptionalArgumentItemBean) result;
231231

232232
assertThat(itemBean).isNotNull();
233-
assertThat(itemBean.getItem().isOmitted()).isFalse();
234-
assertThat(itemBean.getName().isOmitted()).isFalse();
233+
assertThat(itemBean.getItem().isOmitted()).isTrue();
234+
assertThat(itemBean.getName().isPresent()).isFalse();
235235
}
236236

237237
@Test

0 commit comments

Comments
 (0)