Costs while using GraphQL Bulk queries to get all orders/products from a shop

Solved
arjun_rajkumar
Excursionist
25 1 0

Hey!

I ran this bulk query to get all products from a shop. 

 

mutation {
  bulkOperationRunQuery(
    query: """
      {
        products {
    			edges {
      			node {
        			id
        			title
      			}
    			}
  			}
			}
    	""") 
    	{
    		bulkOperation {
        	id
        	status
        	objectCount
        	rootObjectCount
        	completedAt
    		}
      	userErrors {
        	field
        	message
      	}
    	}
  	}

 

 

The shop has over 2000 products .. and it got. all the products correctly! 

But surprisingly the costs are only 10 to get all the data

 

{"cost"=>{"requestedQueryCost"=>10, "actualQueryCost"=>10, "throttleStatus"=>{"maximumAvailable"=>1000.0, "currentlyAvailable"=>990, "restoreRate"=>50.0}}}

 

Question: Will the costs ever go more than this for a bulk query? If the store has 10K products will the costs be more?

Just diving into bulk queries and they looks really efficient. Wondering if I am missing something here?

THanks

Arjun

0 Likes
arjun_rajkumar
Excursionist
25 1 0

Another example - even when I bulk query all the products with all the variants, the costs remain the same.

 

mutation {
  bulkOperationRunQuery(
    query: """
      {
        products {
    			edges {
      			node {
        			id
        			title
        			handle
        			vendor
        			variants {
          			edges {
            			node {
              			taxCode
            			}
          			}
        			}
      			}
    			}
  			}
			}
    	""") 
    	{
    		bulkOperation {
        	id
        	status
        	objectCount
        	rootObjectCount
        	completedAt
    		}
      	userErrors {
        	field
        	message
      	}
    	}
  	}

 

Does Shopify's bulk queries allow us to get all the data from a shop without incuring costs more than 10?

 

Thanks

 

Arjun

0 Likes
Jayvin
Shopify Partner
217 34 56

This is an accepted solution.

Hi,

No you will not encounter any cost issues with bulk query, it will execute and return you a JSONL file when completed.

More info here 

arjun_rajkumar
Excursionist
25 1 0

Another test:

Created a few dummy orders, and one for order I added 50 line items. I then ran the bulk query and got all the orders with all the 50 line items. Still the cost of query was only 10.
{"cost"=>{"requestedQueryCost"=>10, "actualQueryCost"=>10, "throttleStatus"=>{"maximumAvailable"=>1000.0, "currentlyAvailable"=>990, "restoreRate"=>50.0}}}

From my testing it looks like graphql is very efficient. Is there something I am missing here? Or are graphql bulk queries the best way to get large volumes of data from Shopify?
 
Thanks.
Arjun
0 Likes