Api referenceGraphql api

Project Management via the GraphQL API

Learn how to manage projects via the Hive Console GraphQL API.

Projects can be managed via the Hive Console GraphQL API. For more information, please refer to our Projects documentation.

Retrieve a Single Project

Use the Query.project field to retrieve a project either by its id or slug selector.

Example: Retrieve a single Project via Slug
query ProjectBySlug($organizationSlug: String!, $projectSlug: String!) {
  project(
    reference: {
      bySelector: {
        organizationSlug: $organizationSlug
        projectSlug: $projectSlug
      }
    }
  ) {
    id
    type
  }
}

Retrieve a list of Projects within an Organization

Use the Organization.projects field for retrieving a list of projects within the organization. Note: This field will currently return all projects within the organization.

Example: Retrieve a List of Projects within an Organization
query OrganizationProjects($organizationSlug: String!) {
  organization(
    reference: { bySelector: { organizationSlug: $organziationSlug } }
  ) {
    id
    projects {
      edges {
        node {
          id
          type
        }
      }
      pageInfo {
        hasNextPage
        endCursor
      }
    }
  }
}

Create a Project

Use the Mutation.createProject field for creating a new project.

Example: Create a Project
mutation CreateProject($input: CreateProjectInput!) {
  createProject(input: $input) {
    ok {
      createdProject {
        id
        slug
      }
    }
    error {
      message
      inputErrors {
        slug
      }
    }
  }
}

Delete a Project

Use the Mutation.deleteProject field for creating a new project.

Example: Delete a Project
mutation DeleteProject($input: DeleteProjectInput!) {
  deleteProject(input: $input) {
    ok {
      deletedProjectId
    }
    error {
      message
    }
  }
}

Update the Project Slug

Update the project slug using the Mutation.updateProjectSlug field.

mutation UpdateProjectSlug($input: UpdateProjectSlugInput!) {
  updateProjectSlug(input: $input) {
    ok {
      updatedProject {
        id
        slug
      }
    }
    error {
      message
    }
  }
}