Offset based pagination in GraphQL-ruby -
13-Nov-2019 2809
What will you do when a API fetches more that 100 records or more that 1000 records?The first instinct of a developer is to add pagination to the API. Adding pagination restricts the amount of records fetched in single query.The next question is, how to add pagination to GraphQL query?Pagination can be added in two ways:Offset or number based pagination.Cursor based relay style pagination.Adding offset based pagination is the simplest solution. The SQL query needs to be told how many records to skip(i.e: offset) and how many to be fetched from collection(i.e: limit). It is that easy.
Offset based pagination in GraphQL-ruby - #ruby #rubydeveloper #rubyonrails #Offset #based #pagination #GraphQL-ruby https://www.rubyonrails.ba/link/offset-based-pagination-in-graphql-ruby