Skip to content

Show trace to attribute defininion in case of wrong type #223

@povilasjurcys

Description

@povilasjurcys

In case of wrong time we usually receive message such as:

/home/povilas/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/graphql_rails-2.1.0/lib/graphql_rails/attributes/type_parseable.rb:164:in `raise_not_supported_type_error': Type "[Types::SomeTypeWithTypo!]!" is not supported. Supported scalar types are: ["id", "int", "integer", "big_int", "bigint", "float", "double", "decimal", "bool", "boolean", "string", "str", "text", "date", "time", "datetime", "date_time", "json"]. All the classes that includes `GraphqlRails::Model` are also supported as types. (GraphqlRails::Attributes::TypeParseable::UnknownTypeError)
	from /home/povilas/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/graphql_rails-2.1.0/lib/graphql_rails/attributes/input_type_parser.rb:35:in `unwrapped_type'

Sadly, backtrace does not include line where this definition was made so I need to search in the whole project to find that type. It would be nice to see something like this:

/home/povilas/path/to/my/graphql_rails/model.rb:15 `raise_not_supported_type_error': Type "[Types::SomeTypeWithTypo!]!" is not supported. Supported scalar types are: ["id", "int", "integer", "big_int", "bigint", "float", "double", "decimal", "bool", "boolean", "string", "str", "text", "date", "time", "datetime", "date_time", "json"]. All the classes that includes `GraphqlRails::Model` are also supported as types. (GraphqlRails::Attributes::TypeParseable::UnknownTypeError)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions