Skip to content

relayPageInfo

Property Value
Config name relayPageInfo
Default severity
Context Schema
In recommended No

Enforces that the PageInfo type in your schema conforms to the Relay Connection specification. Specifically, it checks that:

  • PageInfo is an object type (not a scalar, enum, etc.)
  • It contains the four required fields with the correct types:
    • hasPreviousPage: Boolean!
    • hasNextPage: Boolean!
    • startCursor: String
    • endCursor: String

Additional fields beyond the four required ones are allowed.

# ❌ Bad — missing required fields
type PageInfo {
totalCount: Int
}
# ❌ Bad — wrong types (cursors must be nullable, booleans must be non-null)
type PageInfo {
hasPreviousPage: Boolean
hasNextPage: Boolean
startCursor: String!
endCursor: String!
}
# ✅ Good — all required fields with correct types
type PageInfo {
hasPreviousPage: Boolean!
hasNextPage: Boolean!
startCursor: String
endCursor: String
}
# ✅ Good — extra fields are fine
type PageInfo {
hasPreviousPage: Boolean!
hasNextPage: Boolean!
startCursor: String
endCursor: String
totalCount: Int
}
extensions:
graphql-analyzer:
lint:
rules:
relayPageInfo: warn