List Records

Query and filter records (todos) in Blue with powerful search and pagination options.


List Records

The todos query allows you to retrieve records from Blue with comprehensive filtering, sorting, and pagination options. You can query records across companies, projects, or filter by specific criteria like assignees, tags, and dates.

Basic Example

List all records in a company with minimal parameters:

query ListRecords {
  todoQueries {
    todos(
      filter: {
        companyIds: ["company_123"]
      }
    ) {
      items {
        id
        title
        done
        duedAt
      }
      pageInfo {
        totalItems
        hasNextPage
      }
    }
  }
}

Advanced Example

Query records with comprehensive filtering, sorting, and field selection:

query ListRecordsAdvanced {
  todoQueries {
    todos(
      filter: {
        companyIds: ["company_123"]
        projectIds: ["project_456", "project_789"]
        assigneeIds: ["user_123"]
        tagIds: ["tag_priority", "tag_urgent"]
        showCompleted: false
        dueStart: "2025-01-01T00:00:00Z"
        dueEnd: "2025-12-31T23:59:59Z"
        search: "product launch"
        excludeArchivedProjects: true
        fields: [
          {
            type: "CUSTOM_FIELD"
            customFieldId: "cf_status_123"
            customFieldType: "SELECT_SINGLE"
            values: ["In Progress", "Review"]
            op: "IN"
          }
        ]
        op: "AND"
      }
      sort: [duedAt_ASC, position_ASC]
      limit: 50
      skip: 0
    ) {
      items {
        id
        uid
        position
        title
        text
        html
        startedAt
        duedAt
        timezone
        color
        cover
        done
        archived
        createdAt
        updatedAt
        commentCount
        checklistCount
        checklistCompletedCount
        isRepeating
        todoList {
          id
          title
        }
        users {
          id
          name
          email
        }
        tags {
          id
          title
          color
        }
        customFields {
          id
          title
          type
          value
        }
        createdBy {
          id
          name
        }
      }
      pageInfo {
        totalPages
        totalItems
        page
        perPage
        hasNextPage
        hasPreviousPage
      }
    }
  }
}

Input Parameters

TodosFilter

ParameterTypeRequiredDescription
companyIds[String!]!✅ YesCompany IDs or slugs to query from
projectIds[String!]NoFilter by specific project IDs or slugs
todoIds[String!]NoRetrieve specific todos by their IDs
assigneeIds[String!]NoFilter by assigned user IDs
tagIds[String!]NoFilter by tag IDs
tagColors[String!]NoFilter by tag colors (hex format)
tagTitles[String!]NoFilter by tag titles
todoListIds[String!]NoFilter by todo list IDs
todoListTitles[String!]NoFilter by todo list titles
doneBooleanNoFilter by completion status (deprecated, use showCompleted)
showCompletedBooleanNoShow/hide completed todos (default: true)
startedAtDateTimeNoFilter by start date
duedAtDateTimeNoFilter by exact due date
dueStartDateTimeNoDue date range start (inclusive)
dueEndDateTimeNoDue date range end (inclusive)
searchStringNoSearch in title and text content
qStringNoAlternative search parameter (same as search)
excludeArchivedProjectsBooleanNoExclude todos from archived projects
coordinatesJSONNoGeo-spatial filter for map view (polygon coordinates)
fieldsJSONNoCustom field filters (see advanced filtering)
opFilterLogicalOperatorNoLogical operator for field filters (AND/OR)

Query Parameters

ParameterTypeRequiredDescription
filterTodosFilter!✅ YesFilter criteria for the query
sort[TodosSort!]NoSort order (default: empty array)
limitIntNoNumber of items per page (default: 20, max: 500)
skipIntNoNumber of items to skip for pagination (default: 0)

TodosSort Values

ValueDescription
assignees_ASCSort by assignee names ascending
assignees_DESCSort by assignee names descending
createdAt_ASCSort by creation date ascending (oldest first)
createdAt_DESCSort by creation date descending (newest first)
createdBy_ASCSort by creator name ascending
createdBy_DESCSort by creator name descending
duedAt_ASCSort by due date ascending (earliest first)
duedAt_DESCSort by due date descending (latest first)
position_ASCSort by position ascending (default list order)
position_DESCSort by position descending
startedAt_ASCSort by start date ascending
startedAt_DESCSort by start date descending
title_ASCSort by title alphabetically ascending
title_DESCSort by title alphabetically descending
todoListPosition_ASCSort by todo list position ascending
todoListPosition_DESCSort by todo list position descending
todoListTitle_ASCSort by todo list title ascending
todoListTitle_DESCSort by todo list title descending
todoTags_ASCSort by tags ascending
todoTags_DESCSort by tags descending

FilterLogicalOperator Values

ValueDescription
ANDAll conditions must match
ORAny condition must match

Custom Field Filtering

The fields parameter supports advanced filtering by custom fields:

{
  "fields": [
    {
      "type": "CUSTOM_FIELD",
      "customFieldId": "cf_123",
      "customFieldType": "SELECT_SINGLE",
      "values": ["Option1", "Option2"],
      "op": "IN"
    }
  ]
}

Custom Field Filter Structure

FieldTypeDescription
typeStringMust be “CUSTOM_FIELD”
customFieldIdStringID of the custom field
customFieldTypeStringType of the custom field
values[String!]Values to filter by
opStringComparison operator (IN, NOT_IN, EQ, etc.)

Supported Custom Field Types

  • Text fields: TEXT_SINGLE, TEXT_MULTI, URL, EMAIL, PHONE, UNIQUE_ID
  • Numeric fields: CURRENCY, NUMBER, FORMULA
  • Selection fields: SELECT_SINGLE, SELECT_MULTI, CHECKBOX, COUNTRY
  • Reference fields: REFERENCE, LOOKUP
  • Date fields: DATE

Response Fields

TodosResult

FieldTypeDescription
items[Todo!]!Array of todo records
pageInfoPageInfo!Pagination metadata

PageInfo

FieldTypeDescription
totalPagesIntTotal number of pages available
totalItemsIntTotal number of items across all pages
pageIntCurrent page number (calculated from skip/limit)
perPageIntNumber of items per page
hasNextPageBoolean!Whether there is a next page
hasPreviousPageBoolean!Whether there is a previous page

Todo Fields

FieldTypeDescription
idID!Unique identifier
uidString!User-friendly unique identifier
positionFloat!Position in the list
titleString!Todo title
textString!Plain text content
htmlString!HTML formatted content
startedAtDateTimeStart date/time
duedAtDateTimeDue date/time
timezoneStringTimezone for dates
colorStringVisual color indicator
coverStringCover image URL
doneBoolean!Completion status
archivedBoolean!Archive status
createdAtDateTime!Creation timestamp
updatedAtDateTime!Last update timestamp
commentCountInt!Number of comments
checklistCountInt!Total checklist items
checklistCompletedCountInt!Completed checklist items
isRepeatingBoolean!Whether todo is recurring
isReadBooleanRead status for current user
isSeenBooleanSeen status for current user
todoListTodoList!Parent todo list
users[User!]!Assigned users
tags[Tag!]!Associated tags
checklists[Checklist!]!Associated checklists
createdByUserUser who created the todo
customFields[CustomField!]!Custom field values
dependOn[Todo!]Blocking todos (dependencies)
dependBy[Todo!]Dependent todos (blocked by this)
timeTrackingTimeTrackingTime tracking data

Required Permissions

Users must have appropriate access to query records:

Access TypeRequirements
Company AccessUser must be a member of the company
Project AccessUser must have access to specific projects (if filtering by project)
Todo VisibilityDepends on user’s role and permissions:
- VIEW_ONLYCan view all accessible todos
- COMMENT_ONLYCan view all accessible todos
- CLIENTMay be restricted to assigned todos only
- MEMBERCan view all project todos
- ADMINCan view all project todos
- OWNERCan view all company todos

Special Restrictions:

  • Users with showOnlyAssignedTodos permission can only see todos assigned to them
  • Hidden todo lists (based on role configuration) are automatically excluded
  • Tag-based permissions may further filter results

Error Responses

Common Errors

The query handles errors gracefully and returns empty results for:

  • Invalid company IDs
  • Inaccessible projects
  • Permission denied scenarios

For severe errors, GraphQL errors may be returned:

{
  "errors": [{
    "message": "Query timeout exceeded",
    "extensions": {
      "code": "QUERY_TIMEOUT"
    }
  }]
}

Important Notes

Performance

  • Default limit: 20 items per page (automatically applied if not specified)
  • Maximum limit: 500 items per request (automatically capped)
  • Optimization: Queries use optimized joins with STRAIGHT_JOIN for best performance
  • Indexing: Common filter fields are indexed for fast querying
  • Custom fields: Extensive custom field filtering support with minimal performance impact
  • Geographic queries: Supports polygon-based coordinate filtering for map views

Date Filtering

  • Date ranges are inclusive
  • Supports overlapping date ranges (todos that start or end within the range)
  • Null dates are handled gracefully (todos without due dates won’t match date filters)
  • All dates should be in ISO 8601 format

Search Behavior

  • Search is case-insensitive
  • Searches in both title and text content
  • Partial word matching is supported
  • Special characters are handled appropriately

Pagination Strategy

  • Use skip and limit for offset-based pagination
  • Calculate current page: page = Math.floor(skip / limit) + 1
  • For large datasets, consider using filters to reduce result size
  • Always check hasNextPage before incrementing skip
  • Create Record: Use createTodo mutation to create new records
  • Update Record: Use updateTodo mutation to modify records
  • Delete Record: Use deleteTodo mutation to remove records
  • List Custom Fields: Query available custom fields for filtering
  • List Projects: Query available projects for filtering