docs(reference/QueryCache): use the v5 filters-object form in 'find' and 'findAll' examples by DucMinhNe · Pull Request #10873 · TanStack/query (original) (raw)
60-60: ⚡ Quick win
Documentation inconsistency: filters parameter is required, not optional.
The documented signature shows filters?: QueryFilters, but the actual implementation requires the filters parameter with a mandatory queryKey property: find(filters: WithRequired<QueryFilters, 'queryKey'>).
This is a pre-existing issue not introduced by this PR, but should be corrected for accuracy.
📝 Suggested documentation fix
-- filters?: QueryFilters: Query Filters
+- filters: QueryFilters: Query Filters
queryKeyis required within the filters object
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@docs/reference/QueryCache.md` at line 60, Update the documentation to match
the implementation: change the `filters?: QueryFilters` entry to indicate
`filters` is required and must include a `queryKey` (e.g., reflect the
implementation signature `find(filters: WithRequired<QueryFilters,
'queryKey'>)`). Ensure the docs for QueryCache (the `filters` parameter) mention
that `queryKey` is mandatory and describe its expected shape or link to the
QueryFilters type. Keep wording minimal and precise so callers know `filters` is
not optional and must contain `queryKey`.
79-80: ⚡ Quick win
Documentation format could be clearer about the single filters parameter.
The current format lists queryKey and filters as if they are separate parameters, but findAll actually accepts a single filters parameter where queryKey is an optional property of that object.
This is a pre-existing issue not introduced by this PR, but could be clarified to avoid confusion.
📝 Suggested documentation fix
Options
-- queryKey?: QueryKey: Query Keys
-- filters?: QueryFilters: Query Filters
+- filters?: QueryFilters: Query Filters
queryKey?: QueryKey: Query Keys - Optional query key to filter by
- Plus other filter options as documented in Query Filters
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@docs/reference/QueryCache.md` around lines 79 - 80, Update the docs to
clarify that the findAll API accepts a single "filters" object parameter (type
QueryFilters) which may include an optional queryKey property, rather than two
separate parameters; change the parameter list to show a single entry like
"filters?: QueryFilters (where filters.queryKey?: QueryKey)" and update the
links to point to the QueryFilters and Query Keys docs so readers understand
queryKey is a property on the filters object (refer to the findAll function and
the QueryFilters and QueryKey types to ensure accurate wording).