FROM CACHE - en_header

Unable to Create Meta Field

awayr
New Member
1 0 1

Hi Guys,

I am new at shopify and tried to develop a new plugin.
I am trying to create a metafield for product using private app.
Request:

const UPDATE_PRICE = gql`
 mutation productVariantUpdate($input: ProductVariantInput!) {
   productVariantUpdate(input: $input) {
     product {
       title
     }
     productVariant {
       id
       metafields(first: 100){
        edges {
          node {
            id
            namespace
            key
            value
          }
        }
       }
     }
   }
 }
`;


//input variable
const productVariableInput = {
                                id: variantId,
                                metafields: [
                                  {
                                    namespace: 'global',
                                    key: 'images', value: 'any thing',
                                    
                                  }
                                ],
                                
                              };



it returns the following response

{"data":{"productVariantUpdate":{"product":{"title":"Product Example","__typename":"Product"},"productVariant":{"id":"gid:\/\/shopify\/ProductVariant\/35832469618851","metafields":{"edges":[],"__typename":"MetafieldConnection"},"__typename":"ProductVariant"},"__typename":"ProductVariantUpdatePayload"}},"extensions":{"cost":{"requestedQueryCost":112,"actualQueryCost":12,"throttleStatus":{"maximumAvailable":1000.0,"currentlyAvailable":988,"restoreRate":50.0}}}}

it returns 200 but never saves it.

Thanks in advance

 

 

Replies 3 (3)
regilio
New Member
1 0 0

Hi, did you find a solution?

I am currently stuck at the same problem.

hardik355
Shopify Partner
209 20 28

Hello 

I'm shopify theme and app developer. i'm already added metafield in my private app but i made app in rails. so please tell me which language are you using. When my app is used for product import with multiple meta fileds. If you need any help let me know i'll will help you if possible.

 

If you have questions, just let me know.
Please Contact Skype: live:hardikradadiya355
Thanks

If helpful then please Like and Accept Solution.
For App Development and Design changes Hire Me.
Skype: live:hardikradadiya355
Thanks
PoojaPillai
New Member
8 0 0

@awayr Use our Easy Metafield which help to bridge to link the Metafields to your store!