---
title: "metaobject"
description: "查询单个元对象详情。"
doc_type: graphql
doc_category: storefront
doc_version: v20270301
source_url:
  html: 'https://developer.shopline.com/zh-hans-cn/docs/storefront-api/metaobjects/queries/metaobject'
  md: 'https://developer.shopline.com/zh-hans-cn/docs/storefront-api/metaobjects/queries/metaobject.md'
---
# metaobject

查询单个元对象详情。

- **Required Scopes:** `unauthenticated_read_metaobjects`
- **API Version:** v20270301
- **API Type:** Storefront
- **API Protocol:** GraphQL
- **Operation Type:** Query

## Required Permissions

* `unauthenticated_read_metaobjects`

接口访问需要令牌，具体如何获取令牌参考：[身份认证](https://developer.shopline.com/zh-hans-cn/docs/apps/api-instructions-for-use/graph-ql-admin-api/overview.md)。

## Arguments

* `id`

  [String](https://developer.shopline.com/zh-hans-cn/docs/storefront-api/common/scalars/string.md)

  元对象 ID。

* `handle`

  [MetaobjectHandleInput](https://developer.shopline.com/zh-hans-cn/docs/storefront-api/metaobjects/objects/metaobject-handle-input.md)

  元对象的标识。

## Returns

* `fields`

  [[MetaobjectField!]!](https://developer.shopline.com/zh-hans-cn/docs/storefront-api/metaobjects/objects/metaobject-field.md)

  元字段列表。  
  

* `handle`

  [String!](https://developer.shopline.com/zh-hans-cn/docs/storefront-api/common/scalars/string.md)

  元对象的唯一标识符。
  

* `id`

  [ID!](https://developer.shopline.com/zh-hans-cn/docs/storefront-api/common/scalars/id.md)

  元对象 ID。   
  

* `type`

  [String!](https://developer.shopline.com/zh-hans-cn/docs/storefront-api/common/scalars/string.md)

  元对象的类型。
  

* `updatedAt`

  [Date!](https://developer.shopline.com/zh-hans-cn/docs/storefront-api/common/scalars/date.md)

  元对象更新的日期和时间。  
  格式：[ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html)。

* `createdAt`

  [Date!](https://developer.shopline.com/zh-hans-cn/docs/storefront-api/common/scalars/date.md)

  元对象的创建日期和时间。  
  格式：[ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html)。

## Examples

### 查询一个元对象

查询一个元对象

**Request:**

```json
query GetMetaobject($id: String!) {
  metaobject(id: $id) {
    id
    type
    handle
    fields {
      key
      type
      value
    }
    createdAt
    updatedAt
  }
}

```

**Response:**

```json
{
  "data": {
    "data": {
      "metaobject": {
        "createdAt": "2026-04-08T02:40:00Z",
        "fields": [
          {
            "key": "fabric_name",
            "type": "single_line_text_field",
            "value": "100% Organic Cotton"
          },
          {
            "value": "40",
            "key": "washing_temperature",
            "type": "number_integer"
          },
          {
            "key": "is_machine_washable",
            "type": "boolean",
            "value": "true"
          },
          {
            "key": "care_instructions",
            "type": "multi_line_text_field",
            "value": "Machine wash warm. Do not bleach. Line dry in shade."
          }
        ],
        "handle": "cotton_basic_care",
        "id": "9876543210",
        "type": "material_care_guide",
        "updatedAt": "2026-04-08T03:20:00Z"
      }
    }
  }
}
```

## Error Handling

关于更多通用错误码说明，参考：[状态码和错误码](https://developer.shopline.com/zh-hans-cn/docs/apps/api-instructions-for-use/storefront-api/overview.md#status-and-error-codes)。

