Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

MetafieldDefinitions GraphQL Query for ownerType PAGE results in Internal Error

Solved

MetafieldDefinitions GraphQL Query for ownerType PAGE results in Internal Error

BenHarkins
Shopify Partner
18 0 4

 

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)

Accepted Solution (1)
SBD_
Shopify Staff
1831 273 423

This is an accepted solution.

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.

Scott | Developer Advocate @ Shopify 

View solution in original post

Replies 4 (4)

SBD_
Shopify Staff
1831 273 423

Hey @BenHarkins 

 

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

Scott | Developer Advocate @ Shopify 

SBD_
Shopify Staff
1831 273 423

This is an accepted solution.

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.

Scott | Developer Advocate @ Shopify 

BenHarkins
Shopify Partner
18 0 4

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"?

SBD_
Shopify Staff
1831 273 423

Great suggestion! Shipping now. Thanks

Scott | Developer Advocate @ Shopify