[Admin GraphQL] Internal Error when querying metafieldDefinitions using ownerType of CUSTOMER

[Admin GraphQL] Internal Error when querying metafieldDefinitions using ownerType of CUSTOMER

tzabian1
Shopify Partner
1 0 0
Looking for help here. Getting the below error when querying for metafieldDefinitions using the Admin API. Tried all versions of the API including unstable. When changing to ownerType to anything else (ie. PRODUCT, ORDER, etc), the query runs fine. Tried contacting support via chat with very little success. Can someone please help!
 
Request:
{
  metafieldDefinitions(first: 5, ownerType: CUSTOMER) {
    edges {
      node {
        key
        namespace
      }
    }
  }
}
Response:
{
    "errors": [
        {
            "message": "Internal error. Looks like something went wrong on our end.\nRequest ID: 92bb7c36-ddd3-40a4-9e0f-b3a22cb0021a (include this in support requests).",
            "extensions": {
                "code": "INTERNAL_SERVER_ERROR",
                "requestId": "92bb7c36-ddd3-40a4-9e0f-b3a22cb0021a"
            }
        }
    ]
}

 Screen Shot 2022-05-12 at 12.49.42 AM.png

 

Example of PRODUCT working and an INVALIDTYPE returning proper errors

Screen Shot 2022-05-12 at 1.03.38 AM.pngScreen Shot 2022-05-12 at 1.05.13 AM.png

Reply 1 (1)

GrahamS
Shopify Staff (Retired)
193 37 54

Hey @tzabian1 ,

 

This error returns when your app doesn't have the necessary permission to access resources owned by whatever ownerType you are requesting through metafieldDefinitions. In this case, you would need to ensure that your app has the read/customers permission before giving it another go.

To learn more visit the Shopify Help Center or the Community Blog.