Depth param not working with global

default discord avatar
jm.sv
last month
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

  • discord user avatar
    jarrod_not_jared
    Payload Team
    last month

    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.sv
    last month

    @jarrod_not_jared both my Home global and Projects collection have

    access: { read: () => true }

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

    Home.ts_paper-triangles-cms-Tuesday-August-01-2023-05.31.58PM2x.png
    Projects.ts_paper-triangles-cms-Tuesday-August-01-2023-05.32.30PM2x.png
  • discord user avatar
    jarrod_not_jared
    Payload Team
    last month

    @jm.sv 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
    notchr
    last month

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

  • discord user avatar
    jarrod_not_jared
    Payload Team
    last month

    Whaddya mean? I set up a relationship just like @jm.sv 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
    notchr
    last month

    Yeah good point @jarrod_not_jared - maybe an older payload vers on their end?



    I cant replicate either

  • discord user avatar
    jarrod_not_jared
    Payload Team
    last month

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

  • default discord avatar
    notchr
    last month

    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.sv
    last month

    @jarrod_not_jared @notchr 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!

  • discord user avatar
    jarrod_not_jared
    Payload Team
    last month

    Nice! No problem 🙂

Open the post
Continue the discussion in Discord
Like what we're doing?
Star us on GitHub!

Star

Connect with the Payload Community on Discord

Discord

online

Can't find what you're looking for?

Get help straight from the Payload team with an Enterprise License.