I followed the GraphQL Admin API docs but I can’t figure this out
mutation call($input: ProductInput!) {
productCreate(input: $input) {
product {
handle
status
title
descriptionHtml
vendor
productType
customProductType
tags
seo {
title
description
}
images(first: 1) {
edges {
node {
altText
src
}
}
}
variants(first: 1) {
edges {
node {
inventoryItem {
cost
tracked
}
inventoryPolicy
inventoryQuantities {
avalaibleQuantity
locationId
}
price
requiresShipping
sku
taxCode
taxable
weight
weightUnit
}
}
}
}
userErrors {
message
field
}
}
}
With payload
{
"input": {
"handle": "iphone-9-64gb-feher",
"status": "ACTIVE",
"title": "iPhone 9 64 GB feher",
"descriptionHtml": "ez a legjobb telo",
"vendor": "ZZ",
"customProductType": "tokok",
"collectionsToJoin": "gid://shopify/Collection/26506562745",
"tags": "type:Hátlapi szilikon,material:Szilikon",
"seo": {
"title": "iPhone 9 64 GB feher - Show Me",
"description": "ez egy naonjao meta description"
},
"images": {
"altText": "a-termek-neve-elvalasztva-kotojellel",
"src":
"http://image-link"
},
"variants": [
{
"inventoryItem": {
"cost": "140990.456",
"tracked": true
},
"inventoryPolicy": "DENY",
"inventoryQuantities": {
"avalaibleQuantity": 5,
"locationId": "gid://shopify/Location/61586669543"
},
"price": "129990",
"requiresShipping": true,
"sku": "SM-023456",
"taxCode": "ÁFA",
"taxable": true,
"weight": 841.36,
"weightUnit": "GRAMS"
}
]
}
}
This mutation gives me the error below
{
"errors": [
{
"message": "Field 'cost' doesn't exist on type 'InventoryItem'",
"locations": [
{
"line": 28,
"column": 21
}
],
"path": [
"mutation call",
"productCreate",
"product",
"variants",
"edges",
"node",
"inventoryItem",
"cost"
],
"extensions": {
"code": "undefinedField",
"typeName": "InventoryItem",
"fieldName": "cost"
}
},
{
"message": "Field 'inventoryQuantities' doesn't exist on type 'ProductVariant'",
"locations": [
{
"line": 32,
"column": 17
}
],
"path": [
"mutation call",
"productCreate",
"product",
"variants",
"edges",
"node",
"inventoryQuantities"
],
"extensions": {
"code": "undefinedField",
"typeName": "ProductVariant",
"fieldName": "inventoryQuantities"
}
}
]
}
Please help me figure out where I might be going wrong, but these fields seem to exist in the docs but not on the API