View the reference document to learn about the data types available in the GraphQL API architecture.
User Guide
Quick Start
GraphQL API provides a unified data access interface, supporting queries (Queries), mutations (Mutations), and object type definitions.This system covers a variety of functions including content management, user information, product data, and comment systems.
Query Operations (Queries)
Query operations are used to retrieve data from the server, supporting a rich set of parameter options and flexible data filtering.
Content Management Query
- archive- Obtain details of a single document or product, supporting methods such as locating content by ID, URL alias, password verification, etc.
- Archives- Get document list, supporting pagination, filtering, sorting, search, and other functions
- archiveParams- Get custom document fields, convenient for handling extended information
- page/Pages- Get single page details or list
- category/categories- Get category details or list
- tag/tags- Get tag details or list
System configuration query
- system- Get system setting information
- contact- Get contact information
- Currency- Get currency information
- index- Get home page TDK information
- languages- Get multi-language site information
User and interaction query
- user- Get user information
- comments- Retrieve comment list
- reviews- Retrieve product review list
- metadata- Retrieve page metadata
Navigation and Display Query
- navs- Retrieve navigation list
- banners- Get home page carousel images
- friendLinks- Get友情链接 friendship links
- filters- Get filtering fields
Change operations (Mutations)
Change operations are used to modify server data.
Rating Management
- createReview- Create product review, supporting rating, content, images, and other review information
Object Type (Objects)
Object type defines the data structure of the API return, including the following main types:
Content-related object
- Archive- Document details, including article and product information
- Archive List- Document list
- Category- Category Information
- Tag- Tag Information
- Page- Single Page Information
User-related Objects
- User- User Information
- UserGroup- User Group Information
- UserGroupSetting- User Group Settings
Product-Related Objects
- Sku- Product SKU Information
- ArchiveSku- Product Specification SKU Information
- ArchiveOption- Product Specification Option
- WholesaleRule- Wholesale Rule
Interactive Related Object
- Comment- Comment Information
- Comment List- Comment List
- Review- Product Reviews
- ReviewList- Product Reviews List
System Related Objects
- System Setting- System Settings
- Contact Setting- Contact Information
- Currency Setting- Currency Settings
- IndexSetting- Home Page TDK Settings
Scalar Type (Scalars)
Basic Data Types:
- String- Text Data
- Int- Integer Value
- Float- Floating Point Value
- Boolean- Boolean value
- JSON- JSON data structure
- ID- Unique identifier
Common query examples
Obtain article details
query GetArticle {
archive(id: 1, render: true) {
id
title
content
description
category {
name
}
tags {
name
}
views
created_time
}
}
Get article list
query GetArticles {
archives(limit: 10, page: 1, category_id: 1) {
items {
id
title
description
thumb
created_time
}
page
total
}
}
Get categories and articles
query GetCategoryWithArticles {
category(id: 1) {
id
title
description
archives(limit: 5) {
items {
id
title
description
}
total
}
}
}
Create a review
mutation CreateReview {
createReview(
content: "很好的产品!"
score: 5
user_name: "用户名"
email: "[email protected]"
) {
id
content
score
user_name
created_time
}
}