Project Management via the 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.

query ProjectBySlug($organizationSlug: String!, $projectSlug: String!) {
  project(
    reference: { bySelector: { organizationSlug: $organizationSlug, projectSlug: $projectSlug } }
  ) {
    id
    type
  }
}
Loading tree-sitter...

Retrieve a list of Projects within an Organization

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

query OrganizationProjects($organizationSlug: String!) {
  organization(reference: { bySelector: { organizationSlug: $organziationSlug } }) {
    id
    projects {
      edges {
        node {
          id
          type
        }
      }
      pageInfo {
        hasNextPage
        endCursor
      }
    }
  }
}
Loading tree-sitter...

Create a Project

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

mutation CreateProject($input: CreateProjectInput!) {
  createProject(input: $input) {
    ok {
      createdProject {
        id
        slug
      }
    }
    error {
      message
      inputErrors {
        slug
      }
    }
  }
}
Loading tree-sitter...

Delete a Project

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

mutation DeleteProject($input: DeleteProjectInput!) {
  deleteProject(input: $input) {
    ok {
      deletedProjectId
    }
    error {
      message
    }
  }
}
Loading tree-sitter...

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
    }
  }
}
Loading tree-sitter...