Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Self-Join Depths Greater Than 1 Not Working #10243

Open
tobiasiv opened this issue Dec 30, 2024 · 0 comments
Open

Self-Join Depths Greater Than 1 Not Working #10243

tobiasiv opened this issue Dec 30, 2024 · 0 comments
Assignees

Comments

@tobiasiv
Copy link

Describe the Bug

The depth parameter for self-joins does not work as expected. It only applies correctly for depths 0 and 1. For example, if you have nested categories up to depth 5, the depth parameter will not fetch beyond the first level of children.

Link to the code that reproduces this issue

https://github.com/tobiasiv/payload-reproduction/tree/self-join-depth

Reproduction Steps

  1. Clone the reproduction repo (branch: self-join-depth)
  2. Set the env variables
  3. pnpm dev
  4. Go to collection Categories and open the document Parent
  5. Switch to the API Tab
  6. Set the depth to 0: You will only see the IDs of the child docs
  7. Set the depth to 1: Children at depth 1 will be fully fetched, and you will see only the IDs of the grandchildren docs
  8. Set the depth to a number greater than 1: The behavior remains the same as with depth 1

Which area(s) are affected? (Select all that apply)

area: core

Environment Info

Binaries:
  Node: 20.16.0
  npm: N/A
  Yarn: N/A
  pnpm: 9.7.0
Relevant Packages:
  payload: 3.12.0
  next: 15.1.0
  @payloadcms/db-mongodb: 3.12.0
  @payloadcms/db-postgres: 3.12.0
  @payloadcms/email-nodemailer: 3.12.0
  @payloadcms/graphql: 3.12.0
  @payloadcms/next/utilities: 3.12.0
  @payloadcms/payload-cloud: 3.12.0
  @payloadcms/richtext-lexical: 3.12.0
  @payloadcms/ui/shared: 3.12.0
  react: 19.0.0
  react-dom: 19.0.0
Operating System:
  Platform: win32
  Arch: x64
  Version: Windows 11 Home
  Available memory (MB): 16263
  Available CPU cores: 8
@tobiasiv tobiasiv added status: needs-triage Possible bug which hasn't been reproduced yet validate-reproduction labels Dec 30, 2024
@github-actions github-actions bot removed the status: needs-triage Possible bug which hasn't been reproduced yet label Dec 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants