---
title: "MessageQueryInput"
description: "用于查询消息列表的输入字段。"
doc_type: graphql
doc_category: storefront
doc_version: v20270301
source_url:
  html: 'https://developer.shopline.com/zh-hans-cn/docs/storefront-api/message/inputs/message-query-input'
  md: 'https://developer.shopline.com/zh-hans-cn/docs/storefront-api/message/inputs/message-query-input.md'
---
# MessageQueryInput

用于查询消息列表的输入字段。

- **API Version:** v20270301
- **API Type:** Storefront
- **API Protocol:** GraphQL
- **Operation Type:** Input

## Input Fields

* `conversationId`

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

  会话 ID，由 [conversationCreate](https://developer.shopline.com/zh-hans-cn/docs/storefront-api/message/mutations/conversation-create.md) 接口在成功调用后返回。

* `pageSize`

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

  分页大小。
  <br/>默认值：`10`

* `messageId`

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

  用作分页游标的消息 ID，与 `createAt` 结合使用。当 `createAt` 相同时，用于查询大于或小于当前 ID 的消息。

* `createAt`

  [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)。不传时，默认按当前时间查询。

* `direction`

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

  查询方向。有效枚举值包含：
  -  `up`：向上查询，查询大于当前 `messageId` 或 `createAt` 的消息。
  -  `down`：向下查询，查询小于当前 `messageId` 或 `createAt` 的消息。

## Argument from

* [Query](https://developer.shopline.com/zh-hans-cn/docs/storefront-api/message/queries/message-query.md).messageQuery

