Search code examples
graphqlrelaygraphql-java

Should list in GraphQL type always be paginated?


As per Relay client specification, and GraphQL specification I got that list should be implemented via Connection and Edges, to give ability to paginate it.

But what if I have a lift of nodes that I don't need to paginate? I mean, I always want to load all entries all the time and there is no business cases where I need only part of that list. Should it be also paginated anyway?


Solution

  • No, pagination is not always necessary. There are many cases where you definitely don't want pagination. For example, a graphql query to get dropdown options for a form. So pagination is optional and depends on your use case. Trust your instinct for if you need pagination or not. You can always change it later.