AWS AppSync allow to define default values in schema like that
type Foo {
bar(
arg: Int = 20
): Bar!
}
or that
type Foo {
bar(
arg: Int! = 20
): Bar!
}
But either way when the value is not explicitly defined, the default value is not passed to the resolver.
Is there something I should opt-in to activate the default value to be passed? Is that an AWS bug? If so, is there a workaround?
PS: In the GraphQL specs
If no value is provided for a defined input object field and that field definition provides a default value, the default value should be used. If no default value is provided and the input object field’s type is non‐null, an error should be thrown. Otherwise, if the field is not required, then no entry is added to the coerced unordered map.