You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a resolver that takes a list of enums as an argument, but when i send something other than that enum ir raises an exception instead of returning an error. e.g:
enum:
class Enums::FooEnum < Enums::BaseObject
value 'Foo1', value: 'foo1'
value 'Foo2', value: 'foo2'
end
resolver:
class Resolvers::BarResolver < Resolvers::Base
argument :foo, [Enums::FooEnum], required: true
def resolve(**args)
# do something that raises `CantDoThatException`
# unless every element of `foo` is a `FooEnum`
end
end
query_1:
bar(foo: [Foo1, Foo2]) {
fields
}
query_2:
bar(foo: [Foo1, 'random_value']) {
fields
}
query_1 works as expected query_2 raises CantDoThatException instead of returning something like:
{
"errors": [
{
"message": "Argument 'dimensions' on Field 'images' has an invalid value. Expected type '[FooEnum!]!'.", ...
...
}
]
}
Edit: After futher investigation i noticed that
>> args[:foo]
['foo1', nil]
So instead of returning an error it is casting all invalidad arguments to nil
The text was updated successfully, but these errors were encountered:
I have a resolver that takes a list of enums as an argument, but when i send something other than that enum ir raises an exception instead of returning an error. e.g:
enum:
resolver:
query_1:
query_2:
query_1
works as expectedquery_2
raises CantDoThatException instead of returning something like:Edit: After futher investigation i noticed that
So instead of returning an error it is casting all invalidad arguments to nil
The text was updated successfully, but these errors were encountered: