Hello I have install the shopify api node package version 3.15.0.
When I send the StagedUploadCreate Mutation i get the error:
RequestError: Variable $input of type [StagedUploadInput!]! was provided invalid value
I don’t find the mistake, here the code:
let input = [];
for await (const [i, jsonlFileContent] of jsonlFileContentList.entries()) {
console.log("Creating staged file for batch:", i);
// Fill input for staged upload mutation
input.push(
{
resource: "BULK_MUTATION_VARIABLES",
filename: `bulk_op_vars_${i}.jsonl`,
mimeType: "text/jsonl",
httpMethod: "POST"
}
);
}
console.log(input);
// Create temporary shopify file.
response = await shopify.graphql(
`#graphql
mutation stagedUploadsCreate($input: [StagedUploadInput!]!) {
stagedUploadsCreate(input: $input) {
stagedTargets {
url
resourceUrl
parameters {
name
value
}
}
userErrors {
field
message
}
}
}
`,
{
variables: {
input: input
}
}
);