Magento – Magento 2.3 GRAPHQL

graphqlmagento2.3

How to run Api request in Magento's newly introduced feature Graphql. I have gone through some of the documents. In my local environemnt, So far I have installed ChromeiQL extension from chrome version 1.0.

The site is in developer mode.

In the search bar i have entered the

http:magento-root-url/graphql

After that i have tried to get the product by filtering price, so i have executed the following query for that,

{
  products (
    filter: {
      price: {
        gt: "1"
      }
    }
  ) 
  {
    items {
        name
    }
  }
}

But it throws following error,

TypeError: Failed to fetch.

Do I need to perform any other Configurations changes before the request is made.

Kindly help me with this..

enter image description here

Best Answer

Not sure about your actual problem. But, it's working fine. Just follow this step :

{
  products (
    filter: {
      price: {
        gt: "40"
        lt: "50"
      }
    }
  ) 
  {
    items {
        name
    }
  }
}

Copy this above query at left side (In query variable part) and just execute "Execute-Query" button (Ctrl + Enter)

enter image description here

Related Topic