Exception: Graphiti::Errors::ImplicitSortTypeMissing

Inherits:
Base
  • Object
show all
Defined in:
lib/graphiti/errors.rb

Instance Method Summary collapse

Constructor Details

#initialize(resource_class, name) ⇒ ImplicitSortTypeMissing

Returns a new instance of ImplicitSortTypeMissing.



541
542
543
544
# File 'lib/graphiti/errors.rb', line 541

def initialize(resource_class, name)
  @resource_class = resource_class
  @name = name
end

Instance Method Details

#messageObject



546
547
548
549
550
551
552
553
554
555
556
# File 'lib/graphiti/errors.rb', line 546

def message
  <<~MSG
    Tried to add sort-only attribute #{@name.inspect}, but type was missing!

    If you are adding a sort that does not have a corresponding attribute, you must pass a type:

    sort :name, :string do <--- like this
      # ... code ...
    end
  MSG
end