Skip to content

Commit

Permalink
Promote methods to public on relay's array conn
Browse files Browse the repository at this point in the history
I recently extracted a gem called
[graphql-page_cursors](https://github.com/artsy/graphql-page_cursors)
that extracts Artsy's graphql pagination approach but it relies on all
connections exposing first and last methods. Unless I'm missing
something, I believe in the case of Relay's Array connection these
methods have been marked private by mistake.
  • Loading branch information
jonallured committed Nov 30, 2020
1 parent 3d11f0f commit 4415a1f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/graphql/relay/array_connection.rb
Expand Up @@ -31,8 +31,6 @@ def has_previous_page
end
end

private

def first
@first ||= begin
capped = limit_pagination_argument(arguments[:first], max_page_size)
Expand All @@ -47,6 +45,8 @@ def last
@last ||= limit_pagination_argument(arguments[:last], max_page_size)
end

private

# apply first / last limit results
def paged_nodes
@paged_nodes ||= begin
Expand Down

0 comments on commit 4415a1f

Please sign in to comment.