Skip to content

Commit fc5d624

Browse files
authored
Fix argument option name.
`replace_null_with_default_value` -> `replace_null_with_default`.
1 parent 9ddb4bd commit fc5d624

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

guides/fields/arguments.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,11 @@ def search_posts(category:)
6666
end
6767
```
6868

69-
Arguments with `required: false` _do_ accept `null` as inputs from clients. This can be surprising in resolver code, for example, an argument with `Integer, required: false` can sometimes be `nil`. In this case, you can use `replace_null_with_default_value: true` to apply the given `default_value: ...` when clients provide `null`. For example:
69+
Arguments with `required: false` _do_ accept `null` as inputs from clients. This can be surprising in resolver code, for example, an argument with `Integer, required: false` can sometimes be `nil`. In this case, you can use `replace_null_with_default: true` to apply the given `default_value: ...` when clients provide `null`. For example:
7070

7171
```ruby
7272
# Even if clients send `query: null`, the resolver will receive `"*"` for this argument:
73-
argument :query, String, required: false, default_value: "*", replace_null_with_default_value: true
73+
argument :query, String, required: false, default_value: "*", replace_null_with_default: true
7474
```
7575

7676
Finally, `required: :nullable` will require clients to pass the argument, although it will accept `null` as a valid input. For example:

0 commit comments

Comments
 (0)