Magento2 GraphQl
- Supports : Magento 2.0.x, 2.1.x, 2.2.x, 2.3.x and 2.4.x
Required to run the following commands in Magento 2 root folder:
php bin/magento setup:upgrade
php bin/magento setup:static-content:deploy
php bin/magento cache:clean
You can check your GraphQL query response by installing chrome extension ChromeiQL or Altair GraphQL addon.
Check using http://127.0.0.1/magento241/graphql url.
{
salesOrder(id: 2) {
increment_id
grand_total
customer_name
is_guest_customer
address_array
customer_name
}
}
Check using http://127.0.0.1/magento241/graphql url.
{
customerPlacedOrder (customer_id: 1) {
allOrderRecords{
increment_id
customer_name
grand_total
created_at
shipping_method
}
}
}
Check using http://127.0.0.1/magento241/graphql url.
{
productCollection {
allProducts {
sku
name
price
status
}
}
}
Check using http://127.0.0.1/magento241/graphql url.
{
cmsPages {
allPages {
name
identifier
content
page_layout
}
}
}