I want to fetch all variants of a product suing shopify graphql api, but it seems like we have to define the number of variants or any other thing we want by using first argument after the query. I want to get all variants of the product instead of defining a number of variants, how can this be possible?
const myproducts = await axios({
url: `https://${req.session.shop}/admin/api/2022-01/graphql.json`,
method: 'post',
headers: {
"X-Shopify-Access-Token": req.session.token,
},
data: {
query: `
{
product(id: "gid://shopify/Product/6829796196490") {
title
variants(first: 5) {
edges {
cursor
node {
selectedOptions {
name
value
}
media(first: 5) {
edges {
node {
alt
mediaContentType
status
__typename
... on MediaImage {
id
preview {
image {
originalSrc
}
}
__typename
}
}
}
}
}
}
pageInfo {
hasNextPage
}
}
}
}
`,
}
});