How to get orders list by customer id in graphql magento 2?

From Magento 2.4 Out of the box, Magento supports Customer Orders History using GraphQL.

You can check the syntax by clicking Retrieve all the Order list of a customer by GraphQL Query

Given Article is used for the learning of GraphQL Practice with Magento. I have written an article before Magento supports the Sales GraphQL feature in the core code.

How to get a list of orders of a customer using GraphQl Magento 2?

We need to create a simple module for getting all the order lists of Customer using GraphQl. Default Magento 2, We can easily get all the orders of a customer by fetch OrderRepository.

Using Graphql, You can get an order list of a specific registered customer by customer id.

We need to create a Resolver model and add our custom logic for getting all the Customer Order list. We will display all the orders of a customer in the response to the query.

I hope you are aware of What is GraphQl and how GraphQL is used in Magento 2 If You are new to GraphQL check the link for GraphQl in Magento 2.

Now we can start the module using Magento 2 to fetch all orders of a specific customer. Continue reading “How to get orders list by customer id in graphql magento 2?”

Get Product collection Using GraphQL Magento 2.

From Magento version 2.3, one of the latest features for the storefront API called GraphQL is introduced.

Out of the Box Magento Products Query with all the possible fields by clicking on the link, Use Product Query GraphQl in Magento to display all the products-related fields.

This example is just for learning purposes. Getting all the product collections using GraphQL in Magento 2 You need to create a simple module for achieving it.

We need to create a Resolver model and add our custom logic for getting all the Product collection.

You can add a custom condition for getting specific Products in the Resolver PHP file based on your requirements. We will display all the products in the response.

Continue reading “Get Product collection Using GraphQL Magento 2.”

Get CMS Pages collection using Graphql Magento 2.

Get All CMS pages using GraphQl in Magento 2 by a simple module.

We can get all the CMS Pages collection by GraphQl by just create the Resolver model and add our custom logic for getting all the CMS Pages collection. You can add a filter to the condition for getting specific CMS Pages in the Resolver PHP file.

If you want to know Out of the Box Magento cmsPage Query, Refer a link with more explanation, Cms Page, and Cms Blocks GraphQL Query in Magento. 

I hope you are aware of What is GraphQl and how GraphQL is used for the programming language like Magento 2 If You are new to GraphQL check the link for GraphQl in Magento.

Continue reading “Get CMS Pages collection using Graphql Magento 2.”