{"record":{"id":"859be6b7077db7b6","repo":"ory/hydra","slug":"plan-must-define-at-least-one-applicablequeries","errorCode":null,"errorMessage":"plan must define at least one ApplicableQueries","messagePattern":"plan must define at least one ApplicableQueries","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"oryx/pagination/paginationplanner/planner.go","lineNumber":28,"sourceCode":")\n\n// PaginationPlanner chooses the best [PaginationPlan] for a queriedColumns.\n// Plan is eligible when its required constraint set is satisfied (and an optional Condition matches).\n// If no plan matches, the FallbackPlan is used.\ntype PaginationPlanner struct {\n\tPlans        []PaginationPlan\n\tFallbackPlan PaginationPlan\n}\n\nfunc NewPaginationPlanner(fallbackPlan PaginationPlan, plans []PaginationPlan) (*PaginationPlanner, error) {\n\tif len(fallbackPlan.DefaultPageToken.Columns()) == 0 {\n\t\treturn nil, errors.New(\"plan must define at least one PageTokenColumn\")\n\t}\n\n\tfor i := range plans {\n\t\tplan := &plans[i]\n\t\tif len(plan.ApplicableQueries) == 0 {\n\t\t\treturn nil, errors.New(\"plan must define at least one ApplicableQueries\")\n\t\t}\n\t\tif len(plan.DefaultPageToken.Columns()) == 0 {\n\t\t\treturn nil, errors.New(\"plan must define a DefaultPageToken\")\n\t\t}\n\t\tplan.populateInternals()\n\t}\n\n\treturn &PaginationPlanner{\n\t\tPlans:        plans,\n\t\tFallbackPlan: fallbackPlan,\n\t}, nil\n}\n\n// GetPaginator selects the first eligible plan for the given queriedColumns constraints.\n// Eligibility requires an exact ColumnSet match and (if set) Condition match.\n// If none match, the FallbackPlan is used for building the Paginator.\nfunc (p *PaginationPlanner) GetPaginator(q Query, pageOpts ...keysetpagination.Option) (*keysetpagination.Paginator, error) {\n\tif len(q) == 0 {","sourceCodeStart":10,"sourceCodeEnd":46,"githubUrl":"https://github.com/ory/hydra/blob/4174065ffb052799890f7480f5360a877a67ffc1/oryx/pagination/paginationplanner/planner.go#L10-L46","documentation":"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.","triggerScenarios":"Thrown at oryx/pagination/paginationplanner/planner.go:28 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","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"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"4174065ffb052799890f7480f5360a877a67ffc1","analyzedAt":"2026-09-03T14:52:41.581Z","contentChangedAt":"2026-09-03T14:52:41.581Z","schemaVersion":2},"datasetVersion":"2026-09-10T17:17:09.494Z"}