Simple GraphQL query fails with INTERNAL_SERVER_ERROR

Topic summary

A user encounters an INTERNAL_SERVER_ERROR when executing a GraphQL query to fetch metafields for a specific CompanyLocation on a Shopify B2B store. The query targets a particular company location ID and requests the first metafield node with namespace and key values.

Key Details:

  • The error includes a request ID for support tracking
  • The query works successfully with other company locations, indicating the issue is isolated to this specific CompanyLocation
  • The app has confirmed read_customers permissions (and potentially read_companies scopes)
  • Permission errors typically provide explicit feedback about missing scopes, ruling out an authorization issue

Current Status:
A support team member acknowledged the query should be supported per official documentation and is escalating to internal development teams to investigate the root cause. The issue remains unresolved and appears to be a server-side problem specific to one company location record.

Summarized with AI on November 14. AI used: claude-sonnet-4-5-20250929.

How come the following trivial query keeps failing with the following error.

INTERNAL_SERVER_ERROR
Internal error. Looks like something went wrong on our end.
Request ID: a5380348-a92f-4fe8-9a57-f61830fa6ab9 (include this in support requests).

Shop: chulo-b2b.myshopify.com

Query:

{
companyLocation(id: “gid://shopify/CompanyLocation/570163490”) {
metafields(first: 1) {
nodes {
namespace
key
value
}
}
}
}

From our docs it does looks like this is supported, I’ll connect with our internal dev teams to see what might be the issue here. In the meantime can you confirm your app has the read_customers, or/and read_companies scopes?

Hi @Liam

Yes I confirm that our app has the read_customers permissions.

Permissions errors are different, they tell you exactly what the missing permission is.

Here, it is clearly an error.

Also, the query works fine with other company locations, so this is not a permission issue. It seems to be an issue with this specific company location.