fix: querying by polymorphic join field relationTo with overrideAccess: false (#11999)

Previously, querying by polymorphic joins `relationTo` with
`overrideAccess: false` caused an error:
```
QueryError: The following paths cannot be queried: relationTo
```

As this field actually doesn't exist in the schema. Now, under condition
that the query comes from a polymorphic join we skip checking
`relationTo` field access.
This commit is contained in:
Sasha
2025-04-07 23:19:43 +03:00
committed by GitHub
parent 09782be0e0
commit b9ffbc6994
5 changed files with 34 additions and 1 deletions

View File

@@ -222,6 +222,7 @@ export default buildConfigWithDefaults({
},
{
slug: 'multiple-collections-parents',
access: { read: () => true },
fields: [
{
type: 'join',
@@ -236,6 +237,7 @@ export default buildConfigWithDefaults({
},
{
slug: 'multiple-collections-1',
access: { read: () => true },
admin: { useAsTitle: 'title' },
fields: [
{
@@ -255,6 +257,7 @@ export default buildConfigWithDefaults({
},
{
slug: 'multiple-collections-2',
access: { read: () => true },
admin: { useAsTitle: 'title' },
fields: [
{