---
title: "collections"
description: "Retrieve the list of collection."
doc_type: graphql
doc_category: adminGraphQL
doc_version: v20270301
source_url:
  html: 'https://developer.shopline.com/docs/admin-graph-ql-api/products-and-collections/queries/collections'
  md: 'https://developer.shopline.com/docs/admin-graph-ql-api/products-and-collections/queries/collections.md'
---
# collections

Retrieve the list of collection.

- **API Version:** v20270301
- **API Type:** Admin
- **API Protocol:** GraphQL
- **Operation Type:** Query

## Arguments

* `after`

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

  Returns elements following the specified cursor. The `first` argument must also be specified when using this argument.

* `before`

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

  Returns elements preceding the specified cursor. The `last` argument must also be specified when using this argument.

* `first`

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

  Returns the first n elements in the list. 

* `last`

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

  Returns the last n elements in the list. 

* `reverse`

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

  Whether to reverse the order of the list. 
  
  ● true: reverse
  
  ● false: do not reverse
  
  Default value: false

* `query`

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

  Use one or more filters for the query. 
  
  | parameter | description |
  | --- | --- |
  | collection_type | Search by collection type (`MANUAL`、`SMART`). If not specified, it will return collection of all types. 
  | title | Search by collection title. Currently, only searching a single title is supported. |
  | updated_at | Search by collection update time. Supports searching within a time range. |
  
  :::tip{title="tip"}
  1. Note that when using **keywords** as parameter values, you need to first escape them.
  2. The current supports a maximum of 5 parameters. Optimizations will be implemented in the future.
  :::
  
  #### Grammar reference
  
  ```js
  title:'T-shirt' AND updated_at:>'2020-10-21T23:39:20Z'
  ```
  

* `sortKey`

  [CollectionSortKeys](https://developer.shopline.com/docs/admin-graph-ql-api/products-and-collections/enums/collection-sort-keys.md)

  Order the base list in ascending manner using the specified sort key.

* `savedSearchId`

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

  The ID of and search's query.

## Returns

* `edges`

  [[CollectionEdge!]](https://developer.shopline.com/docs/admin-graph-ql-api/products-and-collections/objects/collection-edge.md)

  List of edge nodes.

* `nodes`

  [[Collection!]](https://developer.shopline.com/docs/admin-graph-ql-api/products-and-collections/objects/collection.md)

  List of nodes contained within a CollectionEdge.

* `pageInfo`

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

  Pagination Assistance Information.

## Error Handling

For detailed information about common codes, see [Status and error codes](https://developer.shopline.com/docs/apps/api-instructions-for-use/graph-ql-admin-api/overview.md#status-and-error-codes).

