GraphQL

Documentation

Magento Dev Docs — GraphQL
What is GraphQL and why Magento uses it.

Example schemas

These GraphQL schemas are good examples of structure and types:

Building a GraphQL module

https://webkul.com/blog/graphql-implementation-in-magneto2/

After changing a schema.graphqls remember to run php bin/magento cache:clean. Schemas are cached by Magento.

Examples queries for GraphQL Playground

These queries work with the Venia sample data for PWA Studio:

getCategoryList

{
    "id": 2
}

getCmsBlocks

{
    "identifiers": "sample"
}

getNavigationMenu

{
    "id": 2
}

getProductDetails

{
    "urlKey": "valeria-two-layer-tank",
    "onServer": true
}

productSearch

{
    "inputText": "shirt"
}

urlResolver

{
    "urlKey": "valeria-two-layer-tank.html"
}