ory/hydra · error
plan must define at least one ApplicableQueries
Error message
plan must define at least one ApplicableQueries
What it means
Returned by NewPaginationPlanner when one of the registered plans declares an empty ApplicableQueries set. Such a plan could never be selected, indicating a definition bug in the plan passed to the planner constructor.
Source
Thrown at oryx/pagination/paginationplanner/planner.go:28
)
// PaginationPlanner chooses the best [PaginationPlan] for a queriedColumns.
// Plan is eligible when its required constraint set is satisfied (and an optional Condition matches).
// If no plan matches, the FallbackPlan is used.
type PaginationPlanner struct {
Plans []PaginationPlan
FallbackPlan PaginationPlan
}
func NewPaginationPlanner(fallbackPlan PaginationPlan, plans []PaginationPlan) (*PaginationPlanner, error) {
if len(fallbackPlan.DefaultPageToken.Columns()) == 0 {
return nil, errors.New("plan must define at least one PageTokenColumn")
}
for i := range plans {
plan := &plans[i]
if len(plan.ApplicableQueries) == 0 {
return nil, errors.New("plan must define at least one ApplicableQueries")
}
if len(plan.DefaultPageToken.Columns()) == 0 {
return nil, errors.New("plan must define a DefaultPageToken")
}
plan.populateInternals()
}
return &PaginationPlanner{
Plans: plans,
FallbackPlan: fallbackPlan,
}, nil
}
// GetPaginator selects the first eligible plan for the given queriedColumns constraints.
// Eligibility requires an exact ColumnSet match and (if set) Condition match.
// If none match, the FallbackPlan is used for building the Paginator.
func (p *PaginationPlanner) GetPaginator(q Query, pageOpts ...keysetpagination.Option) (*keysetpagination.Paginator, error) {
if len(q) == 0 {View on GitHub (pinned to 4174065ffb)
Solutions
- Add at least one applicable query (or query pattern) to the plan's ApplicableQueries
- Remove the plan from the list if it is no longer meant to match anything
- Guard plan construction with a test asserting every plan has a non-empty ApplicableQueries
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at oryx/pagination/paginationplanner/planner.go:28 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of ory/hydra@4174065ffb (2026-09-03).
Data as JSON: /api/errors/859be6b7077db7b6.
Report an issue: GitHub.