Skip to content

stagedUploadsCreate unkown error #678

Description

@eternalparquet

Hello, the stagedUploadsCreate mutation give an unkown error
RequestError: Variable $input of type [StagedUploadInput!]! was provided invalid value,
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"
                    }
                );
            }
            // 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
                    }
                }
            );
            await sleep(2000);
            let responseJson = await response.json();
```
`

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions