# Tasks Query

{% hint style="info" %}
Queries are responsible to pull data from GraphQL. For more information please read the GraphQL documentation.
{% endhint %}

Below you can view a sample of the task query. The query accepts an input that can filter the list. The list returns the tasks ordered by `createdAt` descending.

### Filter options

* assigneeEmail - filter by assignee email
* reporterEmail - filter by reporter email
* status - filter by task status. See possible options in types below.
* type - filter by task type. See possible options in types below.
* taskId - pass an id of a task to return a single task
* companyId - pass a companyId to filter by. Only usable if a customer has multiple subsidiaries.

{% tabs %}
{% tab title="GraphQL" %}

```graphql
query tasks(
    $assigneeEmail: String
    $reporterEmail: String
    $status: TASK_STATUSES
    $type: TASK_TYPES
    $taskId: String
    $companyId: String
  ) {
    tasks(
      input: {
        paging: { take: 20, skip: 0 }
        filter: {
          assigneeEmail: $assigneeEmail
          reporterEmail: $reporterEmail
          status: $status
          type: $type
          taskId: $taskId
          companyId: $companyId
        }
      }
    ) {
      id
      title
      description
      status
      createdAt
      links {
        label 
        listingId
        contactId
        unitId
        propertyId
      }
      assignee {
        id
        email
        firstName
        lastName
      }
      reporter {
        id
        email
        firstName
        lastName
      }
      comments {
        id
        comment
        createdAt
        user {
          id
          email
          firstName
          lastName
        }
      }
    }
  }

```

{% endtab %}
{% endtabs %}

#### Sample types

<pre class="language-graphql"><code class="lang-graphql"><strong>
</strong>enum TASK_TYPES {
  GENERIC
  EXPOSE_REVIEW
  APPLICANT_REVIEW
}

enum TASK_STATUSES {
  TODO
  IN_PROGRESS
  DONE
}

type Task {
  id: String
  title: String
  description: String
  type: String
  status: String
  numberOfComments: Int
  dueDate: DateTime
  lastSeenAt: DateTime
  archivedAt: DateTime
  createdAt: DateTime
  updatedAt: DateTime
  comments: [TaskComment]
  assignee: User
  reporter: User
}

type TaskComment {
  id: String
  user: User
  comment: String
  createdAt: DateTime
}

</code></pre>
