Query (Queries)

About Queries

Queries are the core components of GraphQL API, used to retrieve data from the server.By defining query fields, the client can precisely request the required data, avoiding unnecessary information.This system provides a wealth of query interfaces, covering content management, user information, product data, comment systems, and more, meeting the data acquisition needs of various application scenarios.

The query interface supports various parameters, allowing data to be filtered, sorted, paginated, and other operations to make data acquisition more flexible and efficient.Each query has a clear return type, ensuring that the client can accurately expect the returned data structure.

archive

Type:Archive

Retrieve document or product details

This query is used to retrieve detailed information about a single document or product, supporting multiple ways to locate the target document, including ID, URL alias, etc.Can be used to obtain specific content such as articles, products, etc., supports password protection of content verification access, as well as HTML rendering of Markdown content.

Parameter

name Description
password (String) Documents protected with a password require the password to be passed for verification before full content can be retrieved
id (Integer) Document ID
filename (String) Filename, equivalent to url_token
url_token (String) Document alias. Special values: previous: prev, next: next
render (Boolean) If it is a Markdown editor, passing render as true will render the content as HTML format
variant (Integer) SKU ID

archiveParams

Type:[CustomField]

Get document custom field

This query is used to retrieve custom field information for a specific document.In a content management system, different documents may require specific custom attributes or extended fields. This interface allows clients to retrieve this additional field data to better display or process the extended information of the document.

Custom fields are typically used to store additional document attributes, such as SEO settings, special configuration options, and business-related extended data, making the document system more flexible and extensible.

Parameter

name Description
filename (String) Filename, equivalent to url_token
url_token (String) Document Alias
render (Boolean) Content Rendering
id (Integer) Document ID

archives

Type:Archive List

Get document list

This query is used to retrieve a list of documents or product data, supporting various filtering and sorting methods.Through this interface, the client can obtain a collection of documents such as articles, products, etc., suitable for scenarios where multiple documents need to be displayed on the homepage, category pages, search results pages, etc.

This query interface provides a rich set of parameters options, enabling pagination, filtering, sorting, and search functions, meeting the needs of document list display in various business scenarios.

Parameter

name Description
parent_id (Integer) Parent ID
exclude_category_id (Integer) Exclude Category ID
exclude_category_ids ([Int]) list of excluded category IDs
module_id (Integer) Model ID
user_id (Integer) User ID
show_flag (Boolean) Whether to display the flag
draft (Boolean) Whether to display the draft
author_id (Integer) Author ID
q (String) Search keywords
like (String) Fuzzy search keywords
keywords (String) Keyword search
type (String) Type筛选
limit (Integer) Limit the number of returned items
render (Boolean) Content Rendering
category_id (Integer) Category ID
tag_id (Integer) Tag ID
tag_ids ([Int]) Tag ID List
flag (String) flag filtering
page (Integer) page number
category_ids ([Int]) Category ID list
show_content (Boolean) Whether to display the content
show_extra (Boolean) Whether to display extended fields
child (Boolean) Does it contain subcategories
order (String) Sorting method
tag (String) Label filtering
offset (Integer) offset
id (Integer) specific ID

banners

Type:[BannerItem]

get home page carousel

Parameter

name Description
type (String) Carousel Type

Categories

Type:[Category]

Get category list

Parameter

name Description
parent_id (Integer) Parent Category ID
module_id (Integer) Model ID
All (Boolean) Whether to get all categories
limit (Integer) Limit the number of returned items
offset (Integer) offset

category

Type:Category

Get category details

Parameter

name Description
id (Integer) Category ID
filename (String) Filename, equivalent to url_token
catnameString) Category Name
url_token (String) category alias
render (Boolean) Content Rendering

comments

Type:Comment list

Get Comment List

Parameter

name Description
order (String) Sorting method
page (Integer) page number
limit (Integer) Limit the number of returned items
offset (Integer) offset
render (Boolean) Content Rendering
id (Integer) Comment ID
user_id (Integer) User ID

contact

Type:Contact Setting

Get contact information


currency

Type:Currency Setting

Get currency information


DIY

Type:[ExtraField]

Get system custom field

Parameter

name Description
render (Boolean) Content Rendering

Filters

Type:[FilterGroup]

Get document, product filtering fields

Parameter

name Description
module_id (Integer) Model ID
show_all (Boolean) Show all filter options
all_text (String) All Display Text
show_price (Boolean) Whether to display price filter
show_category (Boolean) Whether to display category filtering
parent_id (Integer) The parent category ID in category filtering, default as0
category_id (Integer) The ID of the current category, default as0

friendLinks

Type:[FriendLink]

Get friend link


guestbookFields

Type:[CustomField]

Configure comment field


Index

Type:IndexSetting

Get home page TDK information


languages

Type:[MultiLangSite]

Get multilingual site information


metadata

Type:PageMeta

Get current page metadata

Parameter

name Description
path (String) page path
params (JSON) page parameters

module

Type:Module

Get module details

Parameter

name Description
filename (String) Filename, equivalent to url_token
url_token (String) Module alias
id (Integer) Module ID

modules

Type:[Module]

Get module list


navs

Type:[Nav]

Get navigation list

Parameter

name Description
type_id (Integer) Navigation Type ID
show_type (String) Display Type

page

Type:Page

Get single page detail

Parameter

name Description
render (Boolean) Content Rendering
id (Integer) Page ID
filename (String) Filename, equivalent to url_token
url_token (String) Page Alias

Pages

Type:[Page]

Get single page list

Parameter

name Description
limit (Integer) Limit the number of returned items
offset (Integer) offset

Reviews

Type:Review List

Get product review list

Parameter

name Description
user_id (Integer) User ID
order (String) Sorting method
page (Integer) page number
limit (Integer) Limit the number of returned items
offset (Integer) offset
render (Boolean) Content Rendering
id (Integer) Review ID

sku

Type:Sku

Get product SKU information

Parameter

name Description
id (Integer) Product ID
filename (String) Filename, equivalent to url_token
url_token (String) ProductAlias

system

Type:SystemSetting

GetSystemSettingsInfo


tag

Type:Tag

Get document, product tag details

Parameter

name Description
url_token (String) Alias of tag
render (Boolean) Content Rendering
id (Integer) Tag ID
filename (String) Filename, equivalent to url_token

tags

Type:TagList

Get tag list

Parameter

name Description
letter (String) Filter by first letter
page (Integer) page number
item_id (Integer) Project ID
category_id (Integer) Category ID
type (String) Type筛选
order (String) Sorting method
limit (Integer) Limit the number of returned items
offset (Integer) offset
category_ids ([Int]) Category ID list

user

Type:User

Get user information

Parameter

name Description
id (Integer) User ID

Usage Example

Get details of a single document

query GetArchive {
  archive(id: 1, render: true) {
    id
    title
    content
    category {
      name
    }
    tags {
      name
    }
  }
}

Get document list

query GetArchives {
  archives(limit: 10, page: 1, category_id: 1) {
    list {
      id
      title
      summary
      created_at
    }
    pagination {
      total
      page
      limit
    }
  }
}

Get Category Information

query GetCategory {
  category(id: 1) {
    id
    name
    description
    archives(limit: 5) {
      list {
        id
        title
      }
    }
  }
}

Get Comment List

query GetComments {
  comments(page: 1, limit: 20, order: "created_at desc") {
    list {
      id
      content
      author
      created_at
    }
    pagination {
      total
      page
      limit
    }
  }
}

Get Custom Field

query GetArchiveParams {
  archiveParams(id: 1) {
    name
    value
    type
  }
}

Get Navigation Menu

query GetNavs {
  navs(type_id: 1) {
    id
    name
    url
    children {
      id
      name
      url
    }
  }
}

Get System Settings

query GetSystemInfo {
  system {
    site_name
    site_url
    site_logo
    seo_title
    seo_keywords
    seo_description
  }
}