MetafieldDefinitions GraphQL Query for ownerType PAGE results in Internal Error

I tried this query to retrieve PAGE MetafieldDefinitions, which gave an internal exception:

query {
    metafieldDefinitions(first: 250, ownerType: **PAGE**) {
		edges {
			node {
				id, name 
			} 
		}      
    }
  }

Here are the full results:

"message - Internal error. Looks like something went wrong on our end.
Request ID: d0443be7-8a1e-4a8a-bc1a-5f95ed94960e (include this in support requests)., extensions - code - INTERNAL_SERVER_ERROR, requestId - d0443be7-8a1e-4a8a-bc1a-5f95ed94960e"

I tried retrieving Metafield Definitions for other ownerTypes (such as PRODUCT) and it works just fine.

I also tried querying for an individual PAGE Metafield Definition by Id and “null” is returned (other non-PAGE metafield definitions return the values as expected)

Hey @BenHarkins

I’m able to replicate - checking with the metafield folks and will report back.

1 Like

Hey @BenHarkins

You’ll need the content access scope to access page metafield definitions.

That said, the API shouldn’t throw a 500 - the team will investigate. Thanks for flagging.

1 Like

That worked!

May I suggest updated the label in the Admin API Access Scopes UI to something like:

“View or manage articles, blogs, comments, pages, redirects, and metafield definitions”?

Great suggestion! Shipping now. Thanks