Field 'barcode' doesn't exist on type 'ProductVariant'

Highlighted
New Member
1 0 0

Hi everyone, I'm new to shopify, but in current project I have to work with it and add barcode. I thought it would be fast because, we already have working fetch of products and all I need is to add barcode field. In docs I see that it's available and should work fine, in graphiQL in docs it's also works correctly. But right after moment I'm adding this field to query, I'm getting this error...

[ { "message": "Field 'barcode' doesn't exist on type 'ProductVariant'", "locations": [ { "line": 35, "column": 3 } ], "path": [ "query ProductByHandle", "productByHandle", "... on Product", "variants", "edges", "node", "barcode" ], "extensions": { "code": "undefinedField", "typeName": "ProductVariant", "fieldName": "barcode" } } ]


Also this is the part of my request schema. Without barcode field it works smoothly, would appreciate any help

const variantFields = `
  availableForSale
  id
  title
  sku
  barcode
  priceV2 {
    ${priceV2}
  }
`

const variants = `variants(first: ${FIRST_X_VARIANTS}) {
  edges {
    node {
      ${variantFields}
    }
  }
}`

 

0 Likes