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.
PageInfo
must be an Object typePageInfo
must contain fieldshasPreviousPage
andhasNextPage
, that return non-null BooleanPageInfo
must contain fieldsstartCursor
andendCursor
, 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
}