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
My current workaround is an ugly hack, basically editing the generated file to check the value:
var value interface{}
if args["value"] != nil {
value = args["value"].(interface{})
}
return ec.resolvers.Mutation().SetValue(rctx, args["key"].(string), value)
I'm planning to dig into the templates and make a proper fix, but I'm not sure when since I'm pretty busy these days.
What happened?
When trying to use
Any
as an optional input parameter, if you omit it or pass innull
, it panics:The reason seems to be similar to the one in #799 - the relevant line in
generated.go
:The "value" arg should be checked for
nil
before the type assertion. If I make this change directly in the generated file, it works as expected.What did you expect?
Expected no error and the argument to be resolved to
nil
.Minimal graphql.schema and models to reproduce
versions
gqlgen version
? v0.16.0go version
? 1.17The text was updated successfully, but these errors were encountered: