Dedicated to the Hydrogen framework, headless commerce, and building custom storefronts using the Storefront API.
{
products(first: 1) {
edges {
node {
id
title
description
images(first: 3) {
edges {
node {
url
}
}
}
variants(first: 1) {
edges {
node {
price
compareAtPrice
availableForSale
}
}
}
}
}
}
}
{
products(first: 1) {
edges {
node {
id
title
description
images(first: 3) {
edges {
node {
url
}
}
}
}
}
}
}
Solved! Go to the solution
This is an accepted solution.
Solution:
The first query I sent doesn't work for the Storefront API (only works for the Admin API, as tested with the GraphiQL Explorer).
This works
query {
products(first: 1) {
edges {
node {
id
title
description
images(first: 3) {
edges {
node {
url
}
}
}
variants(first: 3) {
edges {
node {
title
price {amount}
availableForSale
}
}
}
}
}
}
}
`,
This is an accepted solution.
Solution:
The first query I sent doesn't work for the Storefront API (only works for the Admin API, as tested with the GraphiQL Explorer).
This works
query {
products(first: 1) {
edges {
node {
id
title
description
images(first: 3) {
edges {
node {
url
}
}
}
variants(first: 3) {
edges {
node {
title
price {amount}
availableForSale
}
}
}
}
}
}
}
`,