GraphQL error: Field 'totalInventory' doesn't exist on type 'Product'

Highlighted
New Member
1 0 0

I made a custom Storefront using the React-Apollo example from: https://github.com/Shopify/storefront-api-examples

When trying to add GraphQL to get more data I sometimes get errors like the following: 

`GraphQL error: Field 'totalInventory' doesn't exist on type 'Product'`

 

I used the GraphQL explorer to make sure the query fields were correct and was hoping someone could shed some light on why this field doesn't exist.

Also note that sometimes just the order of fields in my query makes a difference when the api doesn't return as expected and I'm not sure that it should :S

 

Heres my full query for reference:

const query = gql`
query query {
collections(first: 10) {
edges {
node {
products(first: 50) {
edges {
node {
id
images(first: 10) {
edges {
node {
altText
id
originalSrc
src
transformedSrc
}
}
}
title
priceRange {
maxVariantPrice {
amount
currencyCode
}
minVariantPrice {
currencyCode
amount
}
}
productType
publishedAt
tags
updatedAt
totalInventory
}
}
}
title
}
}
}
shop {
name
description
products(first: 50) {
edges {
node {
id
title
options {
id
name
values
}
variants(first: 250) {
pageInfo {
hasNextPage
hasPreviousPage
}
edges {
node {
id
available
title
selectedOptions {
name
value
}
image {
src
}
price
}
}
}
priceRange {
maxVariantPrice {
amount
currencyCode
}
minVariantPrice {
currencyCode
amount
}
}
description
images(first: 250) {
pageInfo {
hasNextPage
hasPreviousPage
}
edges {
node {
src
}
}
}
descriptionHtml
}
}
}
blogs(first: 4) {
edges {
node {
id
title
articles(first: 10, sortKey: PUBLISHED_AT, reverse: true) {
edges {
node {
contentHtml
content
id
title
publishedAt
excerpt
excerptHtml
handle
image {
src
}
}
}
}
}
}
}
}
pages(first: 15) {
edges {
node {
id
title
bodySummary
body
}
}
}
}
`;
0 Likes