All Refunds for a shop using GraphQL API

Highlighted
New Member
1 0 0

Hello,

 

I am trying to get all the refunds and the associated refunded line items for a shop using bulkOperationRunQuery. Here is my query:

 

query = '''
mutation {
  bulkOperationRunQuery(
  query: """
{
  orders {
    edges {
      node {
        id
        totalPriceSet {
          shopMoney {
            amount
          }}
        name
        displayFinancialStatus
        displayFulfillmentStatus
        
        lineItems {
          edges {
            node {
              id
              variant {
                id
                title
                sku
                product {
                    title
                        }
              }
              name
              quantity
              fulfillmentStatus
              fulfillableQuantity
              refundableQuantity
            }}}
        
        transactions {
          id
          kind
          amountSet {
            shopMoney {
              amount
            }}} 
        
        refunds{
            id
            createdAt
            totalRefundedSet {
                shopMoney{
                    amount
            }}
            refundLineItems {
                edges {
                    node {
                        quantity
                        }
                    }
                }
            }
        }}}
}
"""
  ) {
    bulkOperation {
      id
      status
    }
    userErrors {
      field
      message
    }
  }
}
'''

I am getting the error  

'Queries that contain a connection field within a list field are not currently supported.'

How can I get all refunds with the names/qty of line items refunded or all the refunded line items for bulk orders retrieval?

0 Likes
Highlighted
New Member
5 0 0

Hey! 

Just wondering, did you ever figure out how to do this? I'm having the same problem.

0 Likes