Internal error with Private Metafields

Solved
New Member
2 0 0

Version:  2019-10

I got an error while trying to add privateMetafields to product's variants, here is what I got: 

 

Internal error. Looks like something went wrong on our end.\nRequest ID: 895cdbd0-0980-40e7-846f-df85d8c4776f (include this in support requests)."

 

Thank you!

0 Likes

Success.

Shopify Staff
Shopify Staff
141 24 28

Hey @Techbity 

 

From my search through our Shopify platform logs, it appears that this was your GraphQL Mutation:

mutation { productCreate(input: {title: "Redacted", options: ["color", "size"], images: [{src: "Redacted"}], variants: [{imageSrc: "Redacted", privateMetafields: {key: "external_usItemId", namespace: "external", valueInput: {value: "RedactedId", valueType: "STRING"}}, barcode: "", compareAtPrice: 15, price: 12, sku: "", options: ["pink", "1"]}]}) { product { id images(first: 1) { edges { cursor node { transformedSrc altText } } } } } }

The issue here is that within this mutation for productCreate, you were also attempting to create privateMetafields for a brand new Product Variant. If you would like to create privateMetafields for a Product Variant, it would need to be done in a separate mutation outside of productCreate. For example, you could first use the productCreate mutation to create the brand new Product and Product Variant, and then after use the productVariantUpdate mutation to create the privateMetafields onto the Product Variant. Alternatively you can use the productCreate variant to create the Product first, and then after use the productVariantCreate mutation to create the new Product Variant and its privateMetafields.

 

Hassain | Developer Support Specialist @ Shopify
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Click Accept as Solution 

1 Like
Highlighted
New Member
2 0 0

I got it. Thank you.


@hassain wrote:

Hey @Techbity 

 

From my search through our Shopify platform logs, it appears that this was your GraphQL Mutation:

mutation { productCreate(input: {title: "Redacted", options: ["color", "size"], images: [{src: "Redacted"}], variants: [{imageSrc: "Redacted", privateMetafields: {key: "external_usItemId", namespace: "external", valueInput: {value: "RedactedId", valueType: "STRING"}}, barcode: "", compareAtPrice: 15, price: 12, sku: "", options: ["pink", "1"]}]}) { product { id images(first: 1) { edges { cursor node { transformedSrc altText } } } } } }

The issue here is that within this mutation for productCreate, you were also attempting to create privateMetafields for a brand new Product Variant. If you would like to create privateMetafields for a Product Variant, it would need to be done in a separate mutation outside of productCreate. For example, you could first use the productCreate mutation to create the brand new Product and Product Variant, and then after use the productVariantUpdate mutation to create the privateMetafields onto the Product Variant. Alternatively you can use the productCreate variant to create the Product first, and then after use the productVariantCreate mutation to create the new Product Variant and its privateMetafields.

 


 

0 Likes