I am developing an Angular application, and I have a query like this using axios, where I want to make first parameter dynamic because of pagination size:
await axios({
url: process.env.SHOPIFY_STORE_URL,
method: 'post',
data: {
query: `
query ($pieces: Int) {
products(first: $pieces) {
edges {
node {
id
description
title
storefrontId
productType
totalInventory
tracksInventory
isGiftCard
priceRangeV2 {
minVariantPrice {
amount
currencyCode
}
maxVariantPrice {
amount
currencyCode
}
}
}
}
}
}
`,
variables: {
pieces: this.first,
}
},
headers: {
'Content-Type': 'application/json',
'Accept': 'application/json',
'X-Shopify-Access-Token': process.env.SHOPIFY_PASSWORD,
},
}).then((result) => {...}
If I execute it, passing a variable, I get a response saying that you must provide one of first or last.
Is it because first must be a fixed value or something?