Hello Magento Friends,

In today’s blog, we will learn about How to Get Custom Column Value of Shipment using GraphQL in Magento 2.

In Magento 2, shipments represent the process of delivering orders to customers. While Magento offers a plethora of default attributes for shipments, there are instances where merchants need to include custom data fields to streamline their logistics or integrate with third-party systems. These custom columns could contain information such as delivery instructions, special packaging requirements, or additional tracking details.

Now, let’s dive into the practical aspect of accessing custom column values of shipments using GraphQL in Magento 2. 

Steps to Get Custom Column Value of Shipment using GraphQL in Magento 2:

Step 1: First, we need to create “schema.graphqls” file inside the etc folder.

app\code\Vendor\Extension\etc\

Then add the code as follows

Step 2: After that, we must create a “Shipments.php” file inside the Resolver folder.

app\code\Vendor\Extension\Model\Resolver\

And add the code as given below

Step 3: At last run the upgrade command and compile command then pass the query like below in the server

Output:

custom column value of shipment using graphql

Conclusion:

This way you can retrieve the custom column value of shipment using GraphQL in Magento 2. If you have any doubts, share them with me through the comment section and I will be quick to provide you with a solution. Share the article with your friends, and stay in touch with us for more such Magento 2 tutorials.

Also learn-

Magento 2: How to Get Custom Column Value of Invoice and Credit Memo using GraphQL

Magento 2: How to Get Custom Column Value of Order using GraphQL

Happy Coding!

Click to rate this post!
[Total: 0 Average: 0]