The following path cannot be queried: status","data":[{"path":"status"}]}]

default discord avatar
wiesson
last month
19

Has anyone seen this message? I have updated to 1.7.1 and my request doesn't work anymore



/api/round-trips/62be80ce39974d8a7aaa22c1?publish=true&locale=all


I don't have API authentication enabled, maybe thats the reason?

  • discord user avatar
    jmikrut
    Payload Team
    last month

    so we released a new feature that

    validates

    queries



    you may be wanting to query on

    _status

    but are actually querying on

    status

    which might not exist



    (the field that we inject into your config for drafts / autosave is called

    _status

    )

  • default discord avatar
    wiesson
    last month

    hmm, let me check



    This is interesting - I'm logged-in in the yellow browser but not in incognito

    Screenshot_2023-04-19_at_15.12.36.png
  • discord user avatar
    jmikrut
    Payload Team
    last month

    queries also now respect access control



    for security reasons



    you should not be able to query a field if field-level access control prevents you from reading the field



    this may be related

  • default discord avatar
    wiesson
    last month

    hmm, so how can I quickly add a token that can read everything so that our pages are working again? 😅



    I think I have


      access: {
        read: () => true,
      },

    everywhere, but I'm double checking



    aha! Found it!



    Thanks @jmikrut

    Screenshot_2023-04-19_at_15.33.46.png
  • discord user avatar
    jmikrut
    Payload Team
    last month

    beautiful

  • default discord avatar
    wiesson
    last month

    I was migrating from a custom implementation to

    versions


    so these hard-rules are a bit unfortunate because there maybe docs that are not migrated or still have the old value

  • discord user avatar
    jmikrut
    Payload Team
    last month

    well, we don't throw any errors based on if a doc

    has a value


    we only will throw where query validation errors if you 1. don't have access to the field or 2. the field doesn't exist in the schema itself

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.