tapioca icon indicating copy to clipboard operation
tapioca copied to clipboard

Tapioca v0.17.5 doesn't handle typing of output of custom GraphQL Scalars correctly

Open joeytepp opened this issue 6 months ago • 1 comments

Just noticed what I believe to be a bug when updating to the latest version of the Gem in a project that also uses the graphql-ruby gem and where we have some custom scalar types. While the latest version does a great job of locating the correct type, I'm finding that for input arguments that reference the scalar types, the generated methods in the rbi are always nullable.

I've traced the reason down to this line, and the underlying issue is that the coerce_result of any scalar type has to handle the nil case, but in cases where we have a required input argument the value of the argument will never be null. So the type should only have a T.nilable(...) if the input argument is not required.

joeytepp avatar Jun 26 '25 14:06 joeytepp

Tagging @nicoco007 and @paracycle for visibility since it looks like you added this originally in https://github.com/Shopify/tapioca/pull/1659

joeytepp avatar Jun 26 '25 14:06 joeytepp