Skip to main content

CraftQL

Getting Started with CraftQL

The CraftQL modules allow you to execute mutation query, simple query and GraphQL query against Craft CMS.

Prerequisites

In order to use CraftQL with Make, it is necessary to have a CraftQL plugin installed in your CraftCMS.

The module dialog fields that are displayed in bold (in the Make scenario, not in this documentation article) are mandatory!

Connecting CraftQL to Make

To connect your CraftQL plugin to Make create your token in the CraftQL settings and insert the token into the Make CraftQL module's Create a connection dialog.

Usage

Execute any GraphQL query against CraftQL.

Useful for getting out content.

Example Query

query getOrders {
   entries(type: [Order], orderStatus: confirmed) {
    id,
    ... on Order {
     delivery_address {
      name
      line1
      line2
      city
      zip
     },
     dateCreated
     status
     products {
      ... on products_line {
       qty: pl_qty,      
       price: pl_price,
       product: pl_product_rel {
        ... on Product {
           id
         title
         sku
        }
       }
      }
     }
     total
     totalQty
    }
   }
  }
 

Mutate

Executes a mutation query.

Insert parameters using the JSON > Create JSON module.