add comments

This commit is contained in:
simon lehericey 2023-10-17 16:34:08 +02:00 committed by Paul Chavard
parent 82322e8874
commit 0dd68ab73d

View file

@ -72,6 +72,9 @@ module Connections
end end
end end
# before and after are a serialized version of (timestamp, id)
# first is a number (n) and mean take n element in order ascendant
# last : n element in order descendant
def compute_page_info(before: nil, after: nil, first: nil, last: nil) def compute_page_info(before: nil, after: nil, first: nil, last: nil)
if first.present? && last.present? if first.present? && last.present?
raise GraphQL::ExecutionError.new('Arguments "first" and "last" are exclusive', extensions: { code: :bad_request }) raise GraphQL::ExecutionError.new('Arguments "first" and "last" are exclusive', extensions: { code: :bad_request })