Skip to content

Commit ab86175

Browse files
authored
Merge pull request #2625 from Shopify/ko-uwrap-nilable
Use `T::Utils.unwrap_nilable` for scalar `coerce_input` return types
2 parents c03731e + 84de293 commit ab86175

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

lib/tapioca/dsl/helpers/graphql_type_helper.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ def type_for(type, ignore_nilable_wrapper: false, prepare_method: nil)
8282

8383
# Wrap as non-nilable for required arguments. `coerce_input` supports both
8484
# required and optional; optional arguments are re-wrapped below based on `type.non_null?`
85-
valid_return_type?(return_type) ? RBIHelper.as_non_nilable_type(return_type.to_s) : "T.untyped"
85+
valid_return_type?(return_type) ? (T::Utils.unwrap_nilable(return_type) || return_type).to_s : "T.untyped"
8686
when GraphQL::Schema::InputObject.singleton_class
8787
type_for_constant(unwrapped_type)
8888
when Module

0 commit comments

Comments
 (0)