BulkOperation Graphql API return "null" in URL field

Highlighted
New Member
2 0 0

   I've been using bulk operation graphql API to download the data. However, for some accounts, the URL in the status response is returned as null. Trying to download Contacts, Products & Orders. In some accounts, when there are no contacts, the URL is null and in others when there are few records, the data is returned as null.

 

Query Payload:

mutation {
    bulkOperationRunQuery(query: """
    {
        shop{
               customers {
                      edges {
                             node {
                                    id
                                    createdAt
                                    firstName
                                    email
                                    lastName
                                    averageOrderAmountV2 {
                                           amount
                                    }
                                    totalSpentV2 {
                                           amount
                                    }
                                    ordersCount
                                    state
                                    addresses {
                                           city
                                           country
                                           province
                                            zip
                                    }
                             }
                      }
               }
               products {
                      edges {
                             node {
                                    id
                                    images {
                                           edges {
                                                  node {
                                                         transformedSrc(preferredContentType: PNG)
                                                  }
                                           }
                                    }
                             description
                             title
                             createdAt
                             priceRange {
                                    maxVariantPrice {
                                           amount
                                    }
                             }
                      }
               }
        }
        orders {
               edges {
                      node {
                             id
                             totalPrice
                             createdAt
                             lineItems {
                             edges {
                                    node {
                                           id
                                    }
                             }
                      }
               }
              }
        }
        }
}
""") {
bulkOperation {
        id
        status
}
userErrors {
        field
        message
}
}
}

 

Status API Payload:

{ currentBulkOperation { id status url partialDataUrl errorCode} }
 
In the response once the operation is completed, url value is returned as 'null'. Please suggest.

 

0 Likes
Highlighted
Shopify Staff (Retired)
Shopify Staff (Retired)
624 103 124

Hey @ravisr ,

 

The Shopify GraphQL BulkOperations API should only return a "null" URL in the instances where there are no records returned from your query. So if you are saying that you are seeing a 'null' URL being returned from your customers even though there should be data returned, that is odd and unexpected.

 

In order for me to investigate this more, can you provide me with the store names (ie the {name}.myshopify.com domains) for the stores that are experiencing this issue? Feel free to DM me that information if you are not comfortable sharing it publicly. The other simpler option would be to provide me with the value of the X-Request-ID header from the Shopify API response when you are making the query for "currentBulkOperation" that has a null URL

 

Hassain | Developer Support Specialist @ Shopify
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Click Accept as Solution 

0 Likes
Highlighted
New Member
2 0 0

@hassain  Thanks for your response. Please find the details below:

 

 1. Store name is "trialvoicestore"

2. X-Request-ID is "00da1f3d-8579-4e45-bcb2-1be139d77ee6".

3. Job ID: "gid://shopify/BulkOperation/3248423021"

0 Likes
Highlighted
Shopify Staff (Retired)
Shopify Staff (Retired)
624 103 124

Hey @ravisr ,

 

Thank you for all of the information!

 

I went through the platform logs on our end, and I could not find anything obvious to explain why you were receiving a blank URL.

 

One thing that I can maybe think of is that you are querying the resources of `shop.customer`, `shop.product`, and 'shop.orders, which are all deprecated in favour of just QueryRoot customer, Query Root product, and Query Root orders (https://shopify.dev/docs/admin-api/graphql/reference/object/shop).

 

Due to this deprecation, can you try re-running this bulk operations query into 3 separate bulk operation queries for customers, products, and orders, and see if you get results this way?

 

Hassain | Developer Support Specialist @ Shopify
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Click Accept as Solution 

0 Likes