Skip to content

relayConnectionTypes

PropertyValue
Config namerelayConnectionTypes
Default severity
ContextSchema
In recommendedNo

Enforces that types whose names end in “Connection” follow the Relay connection specification:

  • The type must be an object type (not a scalar, enum, interface, etc.)
  • It must have an edges field that returns a list type
  • It must have a pageInfo field that returns a non-null PageInfo type
# ❌ Bad — missing pageInfo field
type UserConnection {
edges: [UserEdge]
}
# ❌ Bad — edges is not a list type
type UserConnection {
edges: UserEdge
pageInfo: PageInfo!
}
# ❌ Bad — pageInfo is nullable
type UserConnection {
edges: [UserEdge]
pageInfo: PageInfo
}
# ✅ Good — follows Relay connection spec
type UserConnection {
edges: [UserEdge]
pageInfo: PageInfo!
}
# ✅ Good — extra fields are allowed
type UserConnection {
edges: [UserEdge]
pageInfo: PageInfo!
totalCount: Int!
}
extensions:
graphql-analyzer:
lint:
rules:
relayConnectionTypes: warn