GraphQL is a new concept from Magento 2.3 version in Magento eCommerce. Using Graphql we can get sales order data. There are many default core module uses GraphQl for getting data like, Product, CMS Page, and Block, Customer module uses Graphql for getting data of a specific entity. Magento Doesn’t use GraphQl for Sales Specific entity in core module.
I have just demonstrated how to get order data using GraphQl in Magento 2 based on order id. We can get details of Order basic entity, billing address and shipping address and Used items in Order.
We can get Product selected options in Magento 2 by just simple code snippet, We can get selected options of Bundle, Configurable and Grouped product by below code snippet.
Customer purchased the configurable product with different variant and if you need to get selected variant of Product using Programmatically, Below code is useful to get Configurable and Bundle product selected options.
First, you need to get Item Object from a specific order. Call below function in PHP file,