GraphQL is an awesome way to fetch just the right information you need from your backend. It’s commonly used in ‘headless’ environments. Statamic includes a read-only GraphQL API out of the box. Runway extends upon this so you can query your Eloquent models.Documentation Index
Fetch the complete documentation index at: https://runway.duncanmcclean.com/llms.txt
Use this file to discover all available pages before exploring further.
Enabling for resources
GraphQL must be enabled for each of the resources you wish to query. It’s as simple as adding to your config:config/runway.php
Queries
For each resource, there’s two kinds of queries you can do. An ‘index’ query and a ‘show’ query:Index Query
Example of an index query:Show Query
Example of a show query:Relationships
If you’re using the ‘Belongs To’ or ‘Has Many’ fieldtypes provided by Runway, you can also query the related models.brand, instead of brand_id. Runway removes the _id for you so you can build a nice, clean query.