接口访问需要令牌,具体如何获取令牌请参考:身份认证
查询单个菜单信息
Arguments
handle ● String
菜单 handle
id ● ID
菜单 id (若同时传入 id 和 handle,将以 id 查询菜单信息,忽略 handle )
Return
id ● ID!non-null
菜单id
items ● [MenuItem]
菜单项
More
itemsCounts ● Int
菜单项数量
title ● String
菜单的标题
错误码
关于更多通用错误码说明,参考:状态码和错误码
Example
菜单查询
query {
menu(id:"gid://shopline/Menu/5728759581775504415") {
id
title
itemsCounts
items {
id
title
type
url
}
}
}
Response
{
"data": {
"menu": {
"id": "gid://shopline/Menu/5728759581775504415",
"items": [
{
"id": "gid://shopline/MenuItem/1",
"title": "Home",
"type": "FRONTPAGE",
"url": "/home"
},
{
"id": "gid://shopline/MenuItem/2",
"title": "Collections",
"type": "COLLECTIONS",
"url": "/collections-all"
},
{
"id": "gid://shopline/MenuItem/3",
"title": "All products",
"type": "CATALOG",
"url": "/collections"
}
],
"itemsCounts": 3,
"title": "Main menu"
}
},
"extensions": {
"dataloader": {
"individual-statistics": {
"LD-com.shopline.pixiu.pcq.storefront.api.ProductStorefrontQueryV2Service-images": {
"batchLoadCount": 0,
"batchLoadExceptionCount": 0,
"batchLoadExceptionRatio": 0,
"batchLoadRatio": 0,
"cacheHitCount": 0,
"cacheHitRatio": 0,
"loadCount": 0,
"batchInvokeCount": 0,
"loadErrorCount": 0,
"loadErrorRatio": 0
},
"LD-com.shopline.pixiu.pcq.storefront.api.ProductStorefrontQueryV2Service-onlineStoreUrl": {
"batchInvokeCount": 0,
"batchLoadCount": 0,
"batchLoadExceptionCount": 0,
"batchLoadRatio": 0,
"cacheHitCount": 0,
"batchLoadExceptionRatio": 0,
"cacheHitRatio": 0,
"loadCount": 0,
"loadErrorCount": 0,
"loadErrorRatio": 0
},
"LD-com.shopline.pixiu.pcq.storefront.api.ProductStorefrontQueryV2Service-options": {
"batchLoadExceptionRatio": 0,
"loadCount": 0,
"loadErrorCount": 0,
"loadErrorRatio": 0,
"batchLoadRatio": 0,
"cacheHitCount": 0,
"cacheHitRatio": 0,
"batchInvokeCount": 0,
"batchLoadCount": 0,
"batchLoadExceptionCount": 0
},
"LD-com.shopline.pixiu.pcq.storefront.api.ProductStorefrontQueryV2Service-publishedAtForLoader": {
"batchLoadExceptionCount": 0,
"batchLoadExceptionRatio": 0,
"loadErrorCount": 0,
"loadErrorRatio": 0,
"batchInvokeCount": 0,
"batchLoadCount": 0,
"batchLoadRatio": 0,
"cacheHitCount": 0,
"cacheHitRatio": 0,
"loadCount": 0
},
"LD-com.shopline.pixiu.pcq.storefront.api.ProductStorefrontQueryV2Service-template": {
"loadErrorRatio": 0,
"batchInvokeCount": 0,
"batchLoadRatio": 0,
"cacheHitCount": 0,
"cacheHitRatio": 0,
"loadCount": 0,
"loadErrorCount": 0,
"batchLoadCount": 0,
"batchLoadExceptionCount": 0,
"batchLoadExceptionRatio": 0
},
"LD-com.shopline.pixiu.pcq.storefront.api.ProductStorefrontQueryV2Service-variants": {
"batchLoadCount": 0,
"batchLoadExceptionCount": 0,
"batchLoadExceptionRatio": 0,
"batchLoadRatio": 0,
"cacheHitCount": 0,
"cacheHitRatio": 0,
"batchInvokeCount": 0,
"loadCount": 0,
"loadErrorCount": 0,
"loadErrorRatio": 0
},
"LD-com.shopline.merchant.website.openapi.interfaces.OnlineStorefrontApi-commentsQuery": {
"batchLoadExceptionRatio": 0,
"batchLoadRatio": 0,
"cacheHitCount": 0,
"loadCount": 0,
"loadErrorCount": 0,
"cacheHitRatio": 0,
"loadErrorRatio": 0,
"batchInvokeCount": 0,
"batchLoadCount": 0,
"batchLoadExceptionCount": 0
},
"LD-com.shopline.pixiu.pcq.storefront.api.CollectionStorefrontQueryService-queryCollectionByProduct": {
"loadErrorCount": 0,
"loadErrorRatio": 0,
"batchInvokeCount": 0,
"batchLoadExceptionCount": 0,
"batchLoadRatio": 0,
"cacheHitCount": 0,
"batchLoadCount": 0,
"batchLoadExceptionRatio": 0,
"cacheHitRatio": 0,
"loadCount": 0
},
"LD-com.shopline.pixiu.pcq.storefront.api.DescriptionQueryService-query": {
"batchInvokeCount": 0,
"batchLoadCount": 0,
"batchLoadExceptionRatio": 0,
"cacheHitCount": 0,
"loadErrorRatio": 0,
"batchLoadExceptionCount": 0,
"batchLoadRatio": 0,
"cacheHitRatio": 0,
"loadCount": 0,
"loadErrorCount": 0
},
"LD-com.shopline.pixiu.pcq.storefront.api.ProductStorefrontQueryV2Service-variantsForLoader": {
"loadCount": 0,
"loadErrorRatio": 0,
"batchInvokeCount": 0,
"batchLoadRatio": 0,
"cacheHitCount": 0,
"cacheHitRatio": 0,
"loadErrorCount": 0,
"batchLoadCount": 0,
"batchLoadExceptionCount": 0,
"batchLoadExceptionRatio": 0
},
"LD-com.shopline.pixiu.pcq.storefront.api.CollectionStorefrontQueryService-onlineStoreUrl": {
"batchInvokeCount": 0,
"batchLoadExceptionCount": 0,
"cacheHitCount": 0,
"loadCount": 0,
"loadErrorRatio": 0,
"batchLoadCount": 0,
"batchLoadExceptionRatio": 0,
"batchLoadRatio": 0,
"cacheHitRatio": 0,
"loadErrorCount": 0
}
},
"overall-statistics": {
"batchLoadExceptionRatio": 0,
"cacheHitRatio": 0,
"loadCount": 0,
"loadErrorCount": 0,
"loadErrorRatio": 0,
"batchLoadRatio": 0,
"cacheHitCount": 0,
"batchInvokeCount": 0,
"batchLoadCount": 0,
"batchLoadExceptionCount": 0
}
},
"metrics": {
"dataFetcherMetrics": [
{
"dfErrorCode": null,
"dfProtocol": "dubbo",
"dfRootCoordinate": "/menu",
"dfRt": 20,
"dfServiceIdentity": "com.shopline.merchant.website.openapi.interfaces.OnlineStorefrontApi@menuQuery",
"dfStartTime": 1730357374905
}
],
"graphQLMetrics": {
"deepLevel": 3,
"includeDeprecatedField": false,
"includeQuery": false,
"startParseTimeMillis": 1730357374901,
"startTimeMillis": 1730357374900,
"appKey": "ac46139a45013c6d13b3bdb53ba7b12b2af6d35f",
"endParseTimeMillis": 1730357374901,
"loaderCount": 0,
"rt": 27,
"traceId": "34dfaffc2770b5fa23bd4f8ccb49a63f",
"countryCode": null,
"customizedClientIp": "183.90.187.195",
"languageCode": null,
"parseRt": 0,
"clientIp": "183.90.187.195",
"fieldCount": 29,
"merchantId": "4200333804",
"appId": "264149",
"saleChannel": null,
"tenant": "ec20",
"errorFieldsCount": 0,
"operation": "QUERY",
"ratelimitRemaining": 1,
"storeId": "1671771213310",
"successType": "SUCCESS",
"version": "v20250301",
"executionId": "dc584302-1808-4ea6-9045-4829e0f92a96",
"ratelimitPermits": 1,
"namespace": "storefront",
"storePlus": false
}
},
"tracing": {
"parsing": {
"duration": 301196,
"startOffset": 362419
},
"startTime": "2024-10-31T06:49:34.900Z",
"validation": {
"duration": 710641,
"startOffset": 1275959
},
"version": 1,
"duration": 26631305,
"endTime": "2024-10-31T06:49:34.927Z",
"execution": {
"resolvers": [
{
"fieldName": "menu",
"parentType": "Query",
"path": [
"menu"
],
"returnType": "Menu",
"startOffset": 4085230,
"duration": 21336423
},
{
"duration": 21010,
"fieldName": "id",
"parentType": "Menu",
"path": [
"menu",
"id"
],
"returnType": "ID!",
"startOffset": 25560012
},
{
"startOffset": 25630623,
"duration": 11285,
"fieldName": "title",
"parentType": "Menu",
"path": [
"menu",
"title"
],
"returnType": "String"
},
{
"duration": 9375,
"fieldName": "itemsCounts",
"parentType": "Menu",
"path": [
"menu",
"itemsCounts"
],
"returnType": "Int",
"startOffset": 25678671
},
{
"parentType": "Menu",
"path": [
"menu",
"items"
],
"returnType": "[MenuItem]",
"startOffset": 25788542,
"duration": 10261,
"fieldName": "items"
},
{
"duration": 10768,
"fieldName": "id",
"parentType": "MenuItem",
"path": [
"menu",
"items",
0,
"id"
],
"returnType": "ID",
"startOffset": 25923632
},
{
"fieldName": "title",
"parentType": "MenuItem",
"path": [
"menu",
"items",
0,
"title"
],
"returnType": "String",
"startOffset": 25969897,
"duration": 9579
},
{
"duration": 9246,
"fieldName": "type",
"parentType": "MenuItem",
"path": [
"menu",
"items",
0,
"type"
],
"returnType": "MenuItemType",
"startOffset": 26014042
},
{
"path": [
"menu",
"items",
0,
"url"
],
"returnType": "URL",
"startOffset": 26063780,
"duration": 8934,
"fieldName": "url",
"parentType": "MenuItem"
},
{
"path": [
"menu",
"items",
1,
"id"
],
"returnType": "ID",
"startOffset": 26159635,
"duration": 9456,
"fieldName": "id",
"parentType": "MenuItem"
},
{
"duration": 9343,
"fieldName": "title",
"parentType": "MenuItem",
"path": [
"menu",
"items",
1,
"title"
],
"returnType": "String",
"startOffset": 26202232
},
{
"returnType": "MenuItemType",
"startOffset": 26243891,
"duration": 9177,
"fieldName": "type",
"parentType": "MenuItem",
"path": [
"menu",
"items",
1,
"type"
]
},
{
"duration": 8875,
"fieldName": "url",
"parentType": "MenuItem",
"path": [
"menu",
"items",
1,
"url"
],
"returnType": "URL",
"startOffset": 26287148
},
{
"returnType": "ID",
"startOffset": 26364253,
"duration": 9928,
"fieldName": "id",
"parentType": "MenuItem",
"path": [
"menu",
"items",
2,
"id"
]
},
{
"duration": 9020,
"fieldName": "title",
"parentType": "MenuItem",
"path": [
"menu",
"items",
2,
"title"
],
"returnType": "String",
"startOffset": 26407189
},
{
"duration": 9311,
"fieldName": "type",
"parentType": "MenuItem",
"path": [
"menu",
"items",
2,
"type"
],
"returnType": "MenuItemType",
"startOffset": 26448696
},
{
"fieldName": "url",
"parentType": "MenuItem",
"path": [
"menu",
"items",
2,
"url"
],
"returnType": "URL",
"startOffset": 26499069,
"duration": 9327
}
]
}
}
}
}
这篇文章对你有帮助吗?