The best way to build a modern backend + admin UI. No black magic, all TypeScript, and fully open-source, Payload is both an app framework and a headless CMS.
In the list view, when filtering document by a polymorphic relationship field, an exception is thrown. This only seems to happen when the filtered collection has drafts enabled.
[20:25:38] ERROR (payload): QueryError: The following path cannot be queried: version
at validateQueryPaths ((...)/payload/packages/payload/src/database/queryValidation/validateQueryPaths.ts:91:13)
at processTicksAndRejections (node:internal/process/task_queues:95:5)
at async find ((...)/payload/packages/payload/src/collections/operations/find.ts:119:7)
at async findHandler ((...)/payload/packages/payload/src/collections/requestHandlers/find.ts:30:20)
To Reproduce
Create a collection with drafts enabled.
Add a polymorphic relationship field.
Use the Admin UI to filter the collection documents using the relationship field
Link to reproduction
https://github.com/payloadcms/payload/compare/franciscolourenco:reproduce-filter-relationship-versions
Describe the Bug
In the list view, when filtering document by a polymorphic relationship field, an exception is thrown. This only seems to happen when the filtered collection has drafts enabled.
To Reproduce
Payload Version
2.22.0
Adapters and Plugins
No response