Collections
The collections endpoints allow you to retrieve, create, update, and delete information about collections in a database.
List all collections
This query allows you to retrieve a paginated list of all your collections. By default, a maximum of 25 collections are shown per page.
Arguments
- Name
query
- Type
- String!
- Description
Supported filter parameters:
order_by
order_dir
- Name
after
- Type
- String
- Description
Returns the elements that come after the specified cursor.
- Name
first
- Type
- String
- Description
Returns up to the first
n
elements from the list.
Fields
- Label
Collection!
- Description
The Collection query type.
Request
query collectionsQuery($first: Int, $after: String, $query: String!){
collections(query: "order_by:id order_dir:desc last_month", after: "WzVE4OTA5LDEe/4OTA5XQ==", first: 10){
edges{
node{
id
type
name
created_at
...
}
cursor
}
pageInfo{
endCursor
hasNextPage
}
}
}
Response
{
"data": {
"pagination": {
"edges": [{
"node": {
"id": "col_tDs_sAQZrq9RIrPS-BkyD",
"type": "specific_funnels",
"name": "My Collection",
"created_at": "a few seconds ago",
"__typename": "Collection"
...
},
"cursor": "W251bGwsImNvbF90RHNfc0FRWnJxOVJJclBTLUJreUQiXQ=="
}],
"pageInfo": {
"endCursor": "W251bGwsImNvbF90RHNfc0FRWnJxOVJJclBTLUJreUQiXQ==",
"hasNextPage": false
}
}
}
}
Create a collection
This query allows you to add a new collection.
Arguments
- Label
CollectionInput!
- Description
The CollectionInput type.
Fields
- Label
Collection!
- Description
The Collection query type.
Request
mutation mutationName($node: CollectionInput!) {
createCollection(node: $node){
# Collection type fields
}
}
Response
{
"data": {
"pagination": {
"edges": [{
"node": {
"id": "col_tDs_sAQZrq9RIrPS-BkyD",
"type": "specific_funnels",
"name": "My Collection",
"created_at": "a few seconds ago",
"__typename": "Collection"
...
},
"cursor": "W251bGwsImNvbF90RHNfc0FRWnJxOVJJclBTLUJreUQiXQ=="
}],
"pageInfo": {
"endCursor": "W251bGwsImNvbF90RHNfc0FRWnJxOVJJclBTLUJreUQiXQ==",
"hasNextPage": false
}
}
}
}
Retrieve a collection
This query allows you to retrieve a collection by providing their id.
Arguments
- Name
id
- Type
- ID!
- Description
The collection id.
Fields
- Label
Collection!
- Description
The Collection query type.
Request
query collectionQuery($id: Int!){
node(id: $id){
... on Collection{
# Collection type fields
}
}
}
Response
{
"data": {
"pagination": {
"edges": [{
"node": {
"id": "col_tDs_sAQZrq9RIrPS-BkyD",
"type": "specific_funnels",
"name": "My Collection",
"created_at": "a few seconds ago",
"__typename": "Collection"
...
},
"cursor": "W251bGwsImNvbF90RHNfc0FRWnJxOVJJclBTLUJreUQiXQ=="
}],
"pageInfo": {
"endCursor": "W251bGwsImNvbF90RHNfc0FRWnJxOVJJclBTLUJreUQiXQ==",
"hasNextPage": false
}
}
}
}
Update a Collection
This query allows you to perform an update on a Collection.
Arguments
- Name
id
- Type
- ID!
- Description
The collection id.
- Name
node
- Label
CollectionInput!
- Description
The collection node.
Fields
- Label
Collection!
- Description
The Collection query type.
Request
mutation updateCollectionMutation($node: CollectionInput!, $id: ID!){
updateCollection(node: $node, id: $id){
# Collection type fields
}
}
Response
{
"data": {
"pagination": {
"edges": [{
"node": {
"id": "col_tDs_sAQZrq9RIrPS-BkyD",
"type": "specific_funnels",
"name": "My Collection",
"created_at": "a few seconds ago",
"__typename": "Collection"
...
},
"cursor": "W251bGwsImNvbF90RHNfc0FRWnJxOVJJclBTLUJreUQiXQ=="
}],
"pageInfo": {
"endCursor": "W251bGwsImNvbF90RHNfc0FRWnJxOVJJclBTLUJreUQiXQ==",
"hasNextPage": false
}
}
}
}
Delete a Collection
This query allows you to delete collections.
Arguments
- Name
items
- Type
- [ID!]!
- Description
The collection ids.
Fields
- Name
[ID]
- Description
List of collection ids.
Request
mutation deleteCollectionsMutation($items: [ID!]!){
deleteCollections(items: $items){
# [ID] type field
}
}
Response
{
"data": {
"deleteCollections": [
"UHJvZHVjdDoxNTUxMQ==",
"UHJvZHVjdFKWATUxMQ=="
]
}
}