FROM CACHE - en_header

GraphQL Collection Query - Getting "Access denied for collections field."

Kris_Doyle
Shopify Partner
108 0 27

Hi All,

One of my users is triggering the execution of the following query:

{
  collections(first: 250, query: "collection_type:smart") {
    edges {
      node {
        id
        handle
        title
        productsCount
        sortOrder
        image {
          src
        }
      }
      cursor
    }
    pageInfo {
      hasNextPage
    }
  }
}

 

For some reason, this always results in the error "Access denied for collections field.

The weird thing is that it only happens with one specific user, and there's no indication in the error of why it's denied. I'm using online access so I'm guessing it has something to do with that users' permissions, but I'm not sure why they wouldn't be able to query collections. What am I missing? Is there a an admin setting that would allow a shop owner to deny access to collection read for one of their users?

Replies 2 (2)
Kris_Doyle
Shopify Partner
108 0 27

Anyone from Shopify (or anywhere else) have any idea why I'm getting access denied on the above query?

I'm now getting it with a second user but I have no idea what the problem is. The error message only says:
Server error [Access denied for collections field.]

Any assistance would be greatly appreciated, thanks!

Kris_Doyle
Shopify Partner
108 0 27

Hi All,

Reviving this again as it's still an issue. I thought it was a permission problem with the user not having "Products" permission, but I'm not sure this is the case. The user I'm using doesn't have this permission, yet they can still see the page with no issues.

Anyone know definitively what causes this error message?

"Access denied for collections field."

Thanks!