"Unexpected error" occurred when "metafieldsSet" mutation of Admin GraphQL API is executed

Solved

"Unexpected error" occurred when "metafieldsSet" mutation of Admin GraphQL API is executed

morishin
Shopify Partner
8 0 4

I would like to use App-data metafields and tried it. But "Unexpected error" occurred when I executed `metafieldsSet` mutation according to this document.

 

The steps are:

  1.  Create a Shopify app and create an access token including all access scopes.
    スクリーンショット 2023-12-18 17.41.01.pngスクリーンショット 2023-12-18 17.41.12.png
  2. Retrieve the app installation ID,
    s1.png
  3. Create an app-data metafield.
    s2.png
  4.  GraphQL API returns the error: "Unexpected system error. Try again later."

I appreciate any help, thank you.

Accepted Solution (1)
Liam
Shopify Staff
2873 312 821

This is an accepted solution.

Hi again Morishin,

 

It seems that this is a bug on our side, related to how app reserved namespaces are used with app data metafields. While we work on a fix for this, a workaround would be to specify a non-app reserverved namespace. (for example: "custom", and not "$app:foo" or "app--{YOURAPPID}--foo")

 

Thanks for flagging this,

Liam | Developer Advocate @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

View solution in original post

Replies 5 (5)

Liam
Shopify Staff
2873 312 821

Hi Morishin,

 

It does look like you're following the docs correctly, so I've reached out to our internal devs to see if there's an issue on our side. When you get this error is there any response error codes returned too?

Liam | Developer Advocate @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

morishin
Shopify Partner
8 0 4

Hi Liam,

 

Thank you for your response!

After adding a `code` field to `userErrors` to check the error code, I encountered an "Internal Server Error" from the server. 😢

 

s4.png

Liam
Shopify Staff
2873 312 821

This is an accepted solution.

Hi again Morishin,

 

It seems that this is a bug on our side, related to how app reserved namespaces are used with app data metafields. While we work on a fix for this, a workaround would be to specify a non-app reserverved namespace. (for example: "custom", and not "$app:foo" or "app--{YOURAPPID}--foo")

 

Thanks for flagging this,

Liam | Developer Advocate @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

morishin
Shopify Partner
8 0 4

Hi Liam,

 

I got it.

That workaround works for me! Thanks a lot.

spalluel
Shopify Partner
2 0 0

Hello !

Any update on this ?


I have the same issue (getting "Unexpected system error. Try again later.") using a reserved namespace and while using a non-app reserved namespace work, it's clearly an issue regarding on critical parts like Checkout Functions (as stated here: https://shopify.dev/docs/apps/functions/input-output/variables-queries)

 

Thanks in advance !