Graphql query for only line item additions in an order edit.

Topic summary

A developer is seeking a GraphQL query to retrieve only line items that were added during an order edit, triggered by an orders/edited webhook.

Current situation:

  • They have a working query that returns the full order
  • Need to filter out line items that existed before the edit
  • Want to maintain an existing fulfillment location filter

Technical context:

  • The query involves accessing order data via order(id: ...)
  • Includes filtering fulfillment orders by assigned location ID
  • Retrieves line items and variant information

Status: The question remains unanswered with no solutions or alternative approaches provided yet.

Summarized with AI on November 5. AI used: claude-sonnet-4-5-20250929.

Hey all, does anyone know a query that’ll return (eventually) only line items that have been added during an order edit? I only know how to do it for the full order as follows (this is from a orders/edited webhook), but need to avoid (somehow) items that weren’t added during the edit. Bonus if you can retain the fulfillment location filter.

 {% capture query %}
    query {
      order(id: {{ order_edit.order.admin_graphql_api_id | json }}) {
        fulfillmentOrders(
          first: 10
          query: "assigned_location_id:{{ shop.primary_location_id }}"
	) {
          nodes {
            lineItems(first: 100) {
              nodes {
                totalQuantity
		variant {
		  id
		}
              }
            }
          }
        }
      }
    }
  {% endcapture %}