> ## Documentation Index
> Fetch the complete documentation index at: https://docs.occtoo.com/llms.txt
> Use this file to discover all available pages before exploring further.

# folders

> Lists every folder of a source at all levels, sorted by `displayName` unless `order` is given.



**query** `folders(after: String, before: String, dataSourceId: ID!, first: Int, last: Int, order: [FolderSortInput!], where: FolderFilterInput): FoldersConnection`

## Arguments

**`after`**: `String`

Returns the elements in the list that come after the specified cursor.

---

**`before`**: `String`

Returns the elements in the list that come before the specified cursor.

---

**`dataSourceId`**: `ID!` (required)

Global id of the source (`DataSource.id`).

---

**`first`**: `Int`

Returns the first _n_ elements from the list.

---

**`last`**: `Int`

Returns the last _n_ elements from the list.

---

**`order`**: `[FolderSortInput!]`

---

**`where`**: `FolderFilterInput`

## Returns

`FoldersConnection`

**`edges`**: `[FoldersEdge!]`

A list of edges.

---

**`nodes`**: `[Folder!]`

A flattened list of the nodes.

---

**`pageInfo`**: `PageInfo!`

Information to aid in pagination.

---

**`totalCount`**: `Int!`

Identifies the total count of items in the connection.

## Examples

```graphql Query
query Folders($dataSourceId: ID!) {
  folders(dataSourceId: $dataSourceId) {
    edges {
      cursor
      node {
        activeTask {
          __typename
        }
        children {
          __typename
        }
        createdAt
        createdByUser
        dataSource {
          __typename
        }
        dataSourceId
      }
    }
    nodes {
      activeTask {
        artifacts {
          __typename
        }
        awaitingConfirmation
        configuration {
          __typename
          ... on CardsImportConfiguration {
            __typename
          }
        }
        createdAt
        createdBy
        details {
          __typename
          ... on CardsImportDetails {
            __typename
          }
        }
      }
      children {
        edges {
          __typename
        }
        nodes {
          __typename
        }
        pageInfo {
          __typename
        }
        totalCount
      }
      createdAt
      createdByUser
      dataSource {
        cardDefinitions {
          __typename
        }
        createdAt
        dataProviders {
          __typename
        }
        deletedAt
        description
        entries {
          __typename
        }
      }
      dataSourceId
    }
    pageInfo {
      endCursor
      hasNextPage
      hasPreviousPage
      startCursor
    }
    totalCount
  }
}
```

```json Variables
{
  "dataSourceId": "id"
}
```

```json Response
{
  "data": {
    "folders": {
      "edges": [
        {
          "cursor": "string",
          "node": {
            "activeTask": {
              "__typename": "QueuedTask"
            },
            "children": {
              "__typename": "ChildrenConnection"
            },
            "createdAt": "value",
            "createdByUser": "value",
            "dataSource": {
              "__typename": "DataSource"
            },
            "dataSourceId": "id"
          }
        }
      ],
      "nodes": [
        {
          "activeTask": {
            "artifacts": [
              {
                "__typename": "QueuedTaskArtifact"
              }
            ],
            "awaitingConfirmation": true,
            "configuration": {
              "__typename": "CardsImportConfiguration"
            },
            "createdAt": "value",
            "createdBy": "value",
            "details": {
              "__typename": "CardsImportDetails"
            }
          },
          "children": {
            "edges": [
              {
                "__typename": "ChildrenEdge"
              }
            ],
            "nodes": [
              {
                "__typename": "Folder"
              }
            ],
            "pageInfo": {
              "__typename": "PageInfo"
            },
            "totalCount": 1
          },
          "createdAt": "value",
          "createdByUser": "value",
          "dataSource": {
            "cardDefinitions": {
              "__typename": "CardDefinitionsConnection"
            },
            "createdAt": "value",
            "dataProviders": {
              "__typename": "DataProvidersConnection"
            },
            "deletedAt": "value",
            "description": "string",
            "entries": {
              "__typename": "SourceEntriesConnection"
            }
          },
          "dataSourceId": "id"
        }
      ],
      "pageInfo": {
        "endCursor": "string",
        "hasNextPage": true,
        "hasPreviousPage": true,
        "startCursor": "string"
      },
      "totalCount": 1
    }
  }
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.