Simplify your stack and build anything. Or everything.
Build tomorrow’s web with a modern solution you truly own.
Code-based nature means you can build on top of it to power anything.
It’s time to take back your content infrastructure.

Depth param not working with global

default discord avatar
jm.svlast year
10

I'm having trouble getting the

depth

param to get my global type to return anything for a

relationship

type inside of a

group

type. No matter what I pass for depth (2, 3, 4), it only returns the document ID's.



Both the Home global and Projects collection have

read: () => true

for their access levels

  • This tells me that you are making a request and access control is returning false for that collection on those docs

  • default discord avatar
    jm.svlast year
    @281120856527077378

    both my Home global and Projects collection have

    access: { read: () => true }

    . Would there be another config / another area I need to explicitly allow access?

  • @722129234474303508

    I just tried to recreate your issue as you described, and was unable to. If you can recreate it inside the

    test/_community

    folder and open an issue on github that would be great!

  • default discord avatar
    notchrlast year

    I wonder if this is due to the kind of relationship set?

  • Whaddya mean? I set up a relationship just like

    @722129234474303508

    had and then used a global, with a group, with a relationship field inside of it (with the same field config settings)

  • default discord avatar
    notchrlast year

    Yeah good point

    @281120856527077378

    - maybe an older payload vers on their end?



    I cant replicate either

  • yeah possibly old payload, would like to know what version they are on

  • default discord avatar
    notchrlast year

    Probably a coincidence, but someone just made a support post with a similar issue on payload latest, not exact but similar-ish

  • default discord avatar
    jm.svlast year
    @281120856527077378

    @1049775120559898725

    this was a silly mistake, I must have had an old legacy field called

    projects

    on

    Home

    that was populated so it was still returning from the API even though it's no longer part of the schema. I was confusing that for my

    projectsSection.projects

    that I just confirmed is working correctly. Will do some digging to see best practice for handling stale data / fields stuck inside the database. Thank you both for your help!

  • Nice! No problem 🙂

Star on GitHub

Star

Chat on Discord

Discord

online

Can't find what you're looking for?

Get dedicated engineering support directly from the Payload team.