Skip to content

in doesn't filter polymorphic relationship when using uuid and empty array #16195

@Xmaster6y

Description

@Xmaster6y

Describe the Bug

Queries with in:[] on polymorphic relationship doesn't work when using uuid.

access: {
    read: () => ({
      'permissions.entity.value': { in: [] },
    }),
  },

Would not filter anything.

Only saw this #10788 as related.

Link to the code that reproduces this issue

https://github.com/Xmaster6y/bug-in

Reproduction Steps

  1. Create a group or user
  2. Create a page
  3. Go to the page listing an observe the query not being satisfied

Which area(s) are affected?

area: core

Environment Info

Binaries:
  Node: 24.8.0
  npm: 11.11.0
  Yarn: 1.22.22
  pnpm: 10.17.0
Relevant Packages:
  payload: 3.81.0
  next: 16.2.1
  @payloadcms/db-sqlite: 3.81.0
  @payloadcms/drizzle: 3.81.0
  @payloadcms/graphql: 3.81.0
  @payloadcms/next/utilities: 3.81.0
  @payloadcms/richtext-lexical: 3.81.0
  @payloadcms/translations: 3.81.0
  @payloadcms/ui/shared: 3.81.0
  react: 19.2.4
  react-dom: 19.2.4
Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 24.6.0: Mon Jul 14 11:29:54 PDT 2025; root:xnu-11417.140.69~1/RELEASE_ARM64_T8122
  Available memory (MB): 16384
  Available CPU cores: 8

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: coreCore Payload functionalitystatus: needs-triagePossible bug which hasn't been reproduced yet

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions