Do Refund Line Items have a admin_graphql_api_id?

asoola
Tourist
14 0 1

Hi,

Do Refund Line Items have a admin_graphql_api_id

I noticed that when we receive an orders update webhook, it looks like the following:

refund_line_items: [
        {
          id: 249217188337,
          quantity: 2,
          line_item_id: 9055385613581,
         .... // stuff
          line_item: {
            admin_graphql_api_id: 'gid://shopify/LineItem/9055385613581',
           ... // stuff
          },
        },
      ],

 

How come there is no admin_graphql_api_id for refund line items, but there is one for line items ?

Also, how do I query for a specific refund line item in graphql?

 

 

 

 

0 Likes
HunkyBill
Shopify Expert
4509 46 492

I have no idea about your specific issue, but I am sure you can figure it out in 5 minutes using something like Insomnia. My take on refunds and line items is still over the nature of the whole response.

refunds in GQL are returned as an object with no edges or paging, but that object is in fact an array, which is kind of amusing. So when you break it down, simply, you ask for refunds for an order, and iterate the results to get your specific line item ID. Just note that you get these refund line items without the need to ask for the first one, the last one, or heck, even 5 of them. You just get them.

Neat stuff. We thrive on being early adopters of some stuff that is clearly edgy!

Maybe one day you can feed the refund a query param? Maybe one day we will indeed have to use cursors? I will it was comprehensible when you are faced with cursors versus when you are not. The evolving Shopify GQL is just that.. evolving, but in the meantime, has these oddities.

 

Custom Shopify Apps built just for you! hunkybill@gmail.com http://www.resistorsoftware.com
0 Likes