---
title: "segmentMigrations"
description: "已保存的细分列表"
doc_type: graphql
doc_category: adminGraphQL
doc_version: v20270301
source_url:
  html: 'https://developer.shopline.com/zh-hans-cn/docs/admin-graph-ql-api/customers/queries/segment-migrations'
  md: 'https://developer.shopline.com/zh-hans-cn/docs/admin-graph-ql-api/customers/queries/segment-migrations.md'
---
# segmentMigrations

已保存的细分列表

- **Required Scopes:** `read_customers`
- **API Version:** v20270301
- **API Type:** Admin
- **API Protocol:** GraphQL
- **Operation Type:** Query

## Type Signature

`SegmentMigrationConnection`

## Required Permissions

* `read_customers`

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

## Arguments

* `savedSearchId`

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

  通过保存的搜索ID搜索段迁移。

* `after`

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

  返回指定游标之后的元素。如果指定了该参数，也必须要指定 `first` 参数。

* `before`

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

  返回指定游标之前的元素。如果指定了该参数，也必须要指定 `last` 参数。

* `first`

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

  返回列表中的前 n 个元素。

* `last`

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

  返回列表中的最后 n 个元素。

* `reverse`

  [Boolean](https://developer.shopline.com/zh-hans-cn/docs/admin-graph-ql-api/common/scalars/boolean.md)

  是否反转列表的顺序。
  
  ● true：反转
  
  ● false：不反转
  
  默认值：false

## Returns

* `edges`

  [[SegmentMigrationEdge!]](https://developer.shopline.com/zh-hans-cn/docs/admin-graph-ql-api/customers/objects/segment-migration-edge.md)

  edges  列表

* `nodes`

  [[SegmentMigration]](https://developer.shopline.com/zh-hans-cn/docs/admin-graph-ql-api/customers/objects/segment-migration.md)

  节点列表

* `pageInfo`

  [PageInfo!](https://developer.shopline.com/zh-hans-cn/docs/admin-graph-ql-api/common-objects/objects/page-info.md)

  有助于分页的信息

## Code Example

```graphql
 {
	segmentMigrations(savedSearchId, after, before, first, last, reverse ) 
		 {
			# SegmentMigrationConnection fields
		}
}
```

## Examples

### 商家已保存的细分列表

查询商家已保存的细分列表

**Request:**

```json
query {
  segmentMigrations(first: 3, after:null,reverse:false,savedSearchId:null) {
    edges {
      cursor
      node {
        id
        savedSearchId
      }
    }
    nodes {
        id
        savedSearchId
    }
    pageInfo {
        endCursor
        hasNextPage
        hasPreviousPage
        startCursor
    }
  }
}

```

**Response:**

```json
{
  "data": {
    "data": {
      "segmentMigrations": {
        "pageInfo": {
          "endCursor": "E002CE0E792FBA4E98672D39851FDFD6",
          "hasNextPage": true,
          "hasPreviousPage": false,
          "startCursor": "39C77C6A85E202FDAAB6A0D829D4F007"
        },
        "edges": [
          {
            "cursor": "39C77C6A85E202FDAAB6A0D829D4F007",
            "node": {
              "savedSearchId": "GROUP5582449353606848831",
              "id": "gid://shopline/SegmentMigration/GROUP5582449353606848831"
            }
          },
          {
            "cursor": "AF52536A1951B28A30AAE8825A2B69B9",
            "node": {
              "id": "gid://shopline/SegmentMigration/GROUP5582449353892061504",
              "savedSearchId": "GROUP5582449353892061504"
            }
          },
          {
            "cursor": "E002CE0E792FBA4E98672D39851FDFD6",
            "node": {
              "id": "gid://shopline/SegmentMigration/GROUP5582449354143719745",
              "savedSearchId": "GROUP5582449354143719745"
            }
          }
        ],
        "nodes": [
          {
            "id": "gid://shopline/SegmentMigration/GROUP5582449353606848831",
            "savedSearchId": "GROUP5582449353606848831"
          },
          {
            "id": "gid://shopline/SegmentMigration/GROUP5582449353892061504",
            "savedSearchId": "GROUP5582449353892061504"
          },
          {
            "id": "gid://shopline/SegmentMigration/GROUP5582449354143719745",
            "savedSearchId": "GROUP5582449354143719745"
          }
        ]
      }
    }
  }
}
```

## Error Handling

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

