relay-page-info
- Category: Schema
- Rule name: @graphql-eslint/relay-page-info
- Requires GraphQL Schema: trueℹ️
- Requires GraphQL Operations: falseℹ️
Set of rules to follow Relay specification for PageInfo object.
- PageInfomust be an Object type
- PageInfomust contain fields- hasPreviousPageand- hasNextPage, that return non-null Boolean
- PageInfomust contain fields- startCursorand- endCursor, that return either String or Scalar, which can be null if there are no results
Usage Examples
Correct
# eslint @graphql-eslint/relay-page-info: 'error'
 
type PageInfo {
  hasPreviousPage: Boolean!
  hasNextPage: Boolean!
  startCursor: String
  endCursor: String
}Resources
Last updated on