Magidoc

getProjects
Query

Get projects that the user has access to with pagination, filtering and sorting.

When searching for projects by custom field be sure to provide the customFieldFilters parameter to filter project results.

When searching for projects or actions or other object types, be sure to leverage the filtering capabilities as much as possible to avoid needing to page through results unnecessarily.

Access: Requires workspace access

Parameters:

  • workspaceId: The ID of the workspace
  • first: Number of projects to return (default: pagination limit)
  • last: Optional number of projects to return from the end
  • before: Optional cursor for pagination
  • after: Optional cursor for pagination
  • searchParams: Optional search parameters
  • specificIds: Optional array of specific project IDs to include
  • excludedIds: Optional array of project IDs to exclude
  • includeTemplates: Optional flag to include template projects
  • archived: Optional flag to include archived projects (default: false)
  • templatesOnly: Optional flag to return only template projects (default: false)
  • includePublic: Optional flag to include public projects (default: true)
  • includePrivate: Optional flag to include private projects (default: false)
  • includeReadOnly: Optional flag to include read-only projects
  • includeArchived: Optional flag to include archived projects (default: false)
  • rootProjectId: Optional root project ID to filter by
  • userId: Optional user ID for visibility context (whose share/public access rules apply). This does not filter by project owner.
  • ownerIds: Optional user IDs; when set, only projects that include at least one of these users in ownerIds are returned.
  • customFieldFilters: Filter projects by custom field values server-side. Constraints for different custom fields are ANDed. Multiple entries for the same customFieldId are ORed (e.g. two select values = match either value).

Returns: ProjectConnection with edges and page info

Arguments

#

workspaceId

ID !
Non-null

workspaceIds

[ID !]

When provided, overrides workspaceId as the set of workspaces to fetch projects from. Empty array means all accessible workspaces. Each workspace is access-checked independently. Used by dashboard cross-workspace filters.

first = 20

last

before

after

searchParams

specificIds

[ID !]

excludedIds

[ID !]

includeTemplates

archived

templatesOnly

includePublic = true

includePrivate

includeReadOnly

includeArchived

rootProjectId

userId

ownerIds

[ID !]

includeAllProjectsForSystemAdmin

When true and the caller is a system admin, bypasses project membership filters to return all workspace projects. Only use from dashboard widget contexts.

Response

#

Returns ProjectConnection !.

Example

#