Skip to content

Commit

Permalink
fix generating incorrect type for custom scalars
Browse files Browse the repository at this point in the history
  • Loading branch information
Tiedye committed Sep 27, 2023
1 parent 1a6c8a0 commit 484fe31
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 0 additions & 2 deletions lib/tapioca/dsl/helpers/graphql_type_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,6 @@ def type_for(argument)
type_for_constant(unwrapped_type)
when GraphQL::Schema::NonNull.singleton_class
type_for(unwrapped_type.of_type)
when Module
Runtime::Reflection.qualified_name_of(unwrapped_type) || "T.untyped"
else
"T.untyped"
end
Expand Down
4 changes: 2 additions & 2 deletions spec/tapioca/dsl/compilers/graphql_mutation_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ def resolve(boolean:, float:, id:, int:, date:, datetime:, json:, string:, enum_
# typed: strong
class CreateComment
sig { params(boolean: T::Boolean, float: ::Float, id: ::String, int: ::Integer, date: ::Date, datetime: ::Time, json: T::Hash[::String, T.untyped], string: ::String, enum_a: ::String, enum_b: T.any(::String, ::Symbol), input_object: ::CreateCommentInput, custom_scalar: ::CustomScalar).returns(T.untyped) }
sig { params(boolean: T::Boolean, float: ::Float, id: ::String, int: ::Integer, date: ::Date, datetime: ::Time, json: T::Hash[::String, T.untyped], string: ::String, enum_a: ::String, enum_b: T.any(::String, ::Symbol), input_object: ::CreateCommentInput, custom_scalar: T.untyped).returns(T.untyped) }
def resolve(boolean:, float:, id:, int:, date:, datetime:, json:, string:, enum_a:, enum_b:, input_object:, custom_scalar:); end
end
RBI
Expand Down Expand Up @@ -194,7 +194,7 @@ def resolve(loaded_argument:, loaded_arguments:, custom_name:, optional_loaded_a
# typed: strong
class CreateComment
sig { params(loaded_argument: ::LoadedType, loaded_arguments: T::Array[::LoadedType], custom_name: ::LoadedType, optional_loaded_argument: T.nilable(::LoadedType), optional_loaded_arguments: T.nilable(T::Array[::LoadedType])).returns(T.untyped) }
sig { params(loaded_argument: T.untyped, loaded_arguments: T::Array[T.untyped], custom_name: T.untyped, optional_loaded_argument: T.untyped, optional_loaded_arguments: T.nilable(T::Array[T.untyped])).returns(T.untyped) }
def resolve(loaded_argument:, loaded_arguments:, custom_name:, optional_loaded_argument: T.unsafe(nil), optional_loaded_arguments: T.unsafe(nil)); end
end
RBI
Expand Down

0 comments on commit 484fe31

Please sign in to comment.