From 0dd68ab73d1a9e79353c5da8f2eba4f2314753c1 Mon Sep 17 00:00:00 2001 From: simon lehericey Date: Tue, 17 Oct 2023 16:34:08 +0200 Subject: [PATCH] add comments --- app/graphql/connections/cursor_connection.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/graphql/connections/cursor_connection.rb b/app/graphql/connections/cursor_connection.rb index 3f2b53994..5235e7786 100644 --- a/app/graphql/connections/cursor_connection.rb +++ b/app/graphql/connections/cursor_connection.rb @@ -72,6 +72,9 @@ module Connections 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) if first.present? && last.present? raise GraphQL::ExecutionError.new('Arguments "first" and "last" are exclusive', extensions: { code: :bad_request })