统计查询
门店业务指标的聚合统计。订单统计
query($storeId: String!) {
orderStatistics(storeId: $storeId) {
totalOrders
totalRevenue
}
}
支付统计
query($storeId: String!) {
paymentStatistics(storeId: $storeId) {
totalPayments
successRate
}
}
产品统计
query($storeId: String!) {
productStatistics(storeId: $storeId) {
totalProducts
activeProducts
}
}
组合仪表盘查询
在单次请求中获取所有核心指标:query($storeId: String!) {
orderStatistics(storeId: $storeId) {
totalOrders
totalRevenue
}
paymentStatistics(storeId: $storeId) {
totalPayments
successRate
}
productStatistics(storeId: $storeId) {
totalProducts
activeProducts
}
}
{ "storeId": "STO_3bVzrkD0FJjFdZNLk8Ualx" }
SDK 示例
const result = await client.graphql.query<{
orderStatistics: { totalOrders: number; totalRevenue: number };
paymentStatistics: { totalPayments: number; successRate: number };
productStatistics: { totalProducts: number; activeProducts: number };
}>({
query: `query($storeId: String!) {
orderStatistics(storeId: $storeId) { totalOrders totalRevenue }
paymentStatistics(storeId: $storeId) { totalPayments successRate }
productStatistics(storeId: $storeId) { totalProducts activeProducts }
}`,
variables: { storeId: "STO_3bVzrkD0FJjFdZNLk8Ualx" },
});
趋势分析
追踪一段时间内的指标变化:query($storeId: String!) {
trendAnalysis(storeId: $storeId) {
period
orders
revenue
payments
}
}
分布分析
按货币、国家或产品分析收入分布:query($storeId: String!) {
distributionAnalysis(storeId: $storeId) {
dimension
value
count
amount
}
}
客户分析
了解您的客户群体:query($storeId: String!) {
customerAnalysis(storeId: $storeId) {
totalCustomers
newCustomers
returningCustomers
}
}
订阅分析
追踪订阅健康指标:query($storeId: String!) {
subscriptionAnalysis(storeId: $storeId) {
activeSubscriptions
churnRate
mrr
}
}
税务分析
按地区查看税收征收情况:query($storeId: String!) {
taxAnalysis(storeId: $storeId) {
country
taxAmount
orderCount
}
}
退款工单分析
追踪退款模式:query($storeId: String!) {
refundTicketAnalysis(storeId: $storeId) {
totalTickets
approvedCount
rejectedCount
totalRefundedAmount
}
}