relayConnectionTypes
| Property | Value |
|---|---|
| Config name | relayConnectionTypes |
| Default severity | — |
| Context | Schema |
| In recommended | No |
What it checks
Section titled “What it checks”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
edgesfield that returns a list type - It must have a
pageInfofield that returns a non-nullPageInfotype
Examples
Section titled “Examples”# ❌ Bad — missing pageInfo fieldtype UserConnection { edges: [UserEdge]}# ❌ Bad — edges is not a list typetype UserConnection { edges: UserEdge pageInfo: PageInfo!}# ❌ Bad — pageInfo is nullabletype UserConnection { edges: [UserEdge] pageInfo: PageInfo}# ✅ Good — follows Relay connection spectype UserConnection { edges: [UserEdge] pageInfo: PageInfo!}# ✅ Good — extra fields are allowedtype UserConnection { edges: [UserEdge] pageInfo: PageInfo! totalCount: Int!}Configuration
Section titled “Configuration”extensions: graphql-analyzer: lint: rules: relayConnectionTypes: warn