GraphQL
Viglet Shio provides a GraphQL API for querying content. GraphQL is ideal for decoupled frontends, mobile applications, and any scenario where you need to request exactly the data you need in a single request.
GraphiQL Console
Section titled “GraphiQL Console”Shio includes a built-in GraphiQL interactive console for exploring and testing GraphQL queries:
http://localhost:2710/graphiqlThe console provides:
- Schema explorer: browse available types and fields
- Auto-complete: type-ahead suggestions for queries
- Query history: review and re-run previous queries
- Documentation: inline documentation for all types
Querying Content
Section titled “Querying Content”Query Posts
Section titled “Query Posts”Retrieve posts from a specific folder:
{ posts(folderId: "folder-uuid") { id title summary postType publishStatus date attributes { name value } }}Query a Single Post
Section titled “Query a Single Post”{ post(id: "post-uuid") { id title summary postType publishStatus attributes { name value } }}Query Folders
Section titled “Query Folders”{ folders(siteId: "site-uuid") { id name parentFolder children { id name } }}Query Sites
Section titled “Query Sites”{ sites { id name description url }}Use Cases
Section titled “Use Cases”| Use Case | Why GraphQL |
|---|---|
| Single-Page Applications | Fetch exactly the fields you need in one request |
| Mobile Apps | Minimize payload size by selecting specific fields |
| Content Aggregation | Combine posts, folders, and site data in a single query |
| Prototyping | Use GraphiQL to explore the content model interactively |
Authentication
Section titled “Authentication”GraphQL queries require authentication. Use session-based authentication (same as the REST API) or configure API access as needed.
Related Pages
Section titled “Related Pages”| Page | Description |
|---|---|
| REST API Reference | Full REST API endpoint documentation |
| Content Modeling | Post Types and fields |
| Developer Guide | Dev environment and project structure |