GraphQl: Bulk operation

I am trying to retrieve all the variants of products in my store, but I keep encountering an error when trying to access the images or inventory levels of the products.

The error message states: ‘The parent ‘node’ field for a nested connection must select the ‘id’ field without an alias and must be of ‘ID’ return type. Connection fields without ‘id’: productVariants.’

My code:

query = <<~QUERY
mutation {
  bulkOperationRunQuery(
    query: """
    {
      productVariants {
        edges {
          node {
            title
            sku
            product {
              title
              images(first: 5) {
                edges {
                  node {
                    url
                  }
                }
              }
            }
            inventoryItem {
              inventoryLevels(first: 5) {
                edges {
                  node {
                    available
                    location {
                      name
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
    """
  ) {
    bulkOperation {
      id
      status
    }
    userErrors {
      field
      message
    }
  }
}
QUERY

Hi @moha6 :waving_hand:

We just need to return the productVariants.id field for the root when nested for a bulk operation. So it’ll look something like the below instead:

{
    productVariants {
        edges {
            node {
                id
                title
                sku
                product {
                     ...

Hope that helps!

thank’s it worked