Import large amount of products using nodejs

Import large amount of products using nodejs

syedusama0786
Shopify Partner
47 2 12

Anyone can tell me about BulkOperationRunMutatuion for adding large amount of products like 50k.
How we can change this data into JSONL form and run the Bulk operation.
Anyone now about that?
Thanks in advance!

Replies 3 (3)

PaulNewton
Shopify Partner
7722 678 1627

The bulk operation dev docs outline changine a mutation to a bulk mutation

https://shopify.dev/api/usage/bulk-operations/queries#bulk-query-workflow 

 

And keep in mind the resource limitations that kick in when a non-Plus store hits 50k products

 

Stores with 50,000 or more variants are subject to a daily rate limit for uploading variants by usin....


 

 

Contact paull.newton+shopifyforum@gmail.com for the solutions you need


Save time & money ,Ask Questions The Smart Way


Problem Solved? ✔Accept and Like solutions to help future merchants

Answers powered by coffee Thank Paul with a Coffee for more answers or donate to eff.org


syedusama0786
Shopify Partner
47 2 12

Yeah sure I will keep it in my and thank you for reply hopefully I will be able to do this now

syedusama0786
Shopify Partner
47 2 12

@PaulNewton Hey !
I create a mutation stagedUploadsCreate but it returns resourceUrl as a null.
how can I upload the jsonl file to the Shopify ?

const STAGED_UPLOADS_CREATE = `mutation stagedUploadsCreate($input: [StagedUploadInput!]!) {
        stagedUploadsCreate(input: $input) {
        stagedTargets {
            url
            resourceUrl
            parameters {
                name
                value
            }
            }
        }
    }`
    const client = new shopify.api.clients.Graphql({ session });
    try {
        const resp = await client.query({
            data: {
                query: STAGED_UPLOADS_CREATE,
                variables: {
                    input: [
                        {
                            filename: 'products.jsonl',
                            mimeType: "text/jsonl",
                            httpMethod: "POST",
                            resource: "BULK_MUTATION_VARIABLES"
                        }
                    ]
                },
            },
        });
    } catch (error) {
        if (error instanceof GraphqlQueryError) {
            throw new Error(
                `${error.message}\n${JSON.stringify(error.response, null, 2)}`
            );
        } else {
            throw error;
        }
    }

This is the code for stagedUploadCreate mutation..
And One more thing i want to ask..

syedusama0786_0-1674731146457.png

What does that mean in above pic?
Please Help me I am stuck here for about 3 4 days.
Thanks in advance!