Exception: Graphiti::Errors::UnsupportedPagination

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

Instance Method Summary collapse

Instance Method Details

#messageObject



668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
# File 'lib/graphiti/errors.rb', line 668

def message
  <<~MSG
    It looks like you are requesting pagination of a sideload, but there are > 1 parents.

    This is not supported. In other words, you can do

    /employees/1?include=positions&page[positions][size]=2

    But not

    /employees?include=positions&page[positions][size]=2

    This is a limitation of most datastores; the same issue exists in ActiveRecord.

    Consider using a named relationship instead, e.g. 'has_one :top_comment'
  MSG
end