/
Subcomponent GraphQL Operations

Subcomponent GraphQL Operations

Table of Contents

Overview

This document provides an overview of the GraphQL API for managing subcomponents within a project. It includes the available queries and mutations, as well as the types used in the API.

Schemas

Query

folder

Fetches a specific folder by its ID.

Arguments:

  • id: String! - The unique identifier of the folder. Required

Returns:

Example:

query { folder(id: "folder-10004-9e93307c-12ab-4a6a-9119-e427f0f1e04e") { id name projectId after parentId description } }

folders

Fetches all folders for a given project.

Arguments:

  • projectId: String! - The unique identifier of the project. Required

Returns:

  • [Folder] - An array of folders.

Example:

query { folders(projectId: "10000") { id name projectId after parentId description }

subcomponents

Fetches all subcomponents for a given project.

Arguments:

  • projectId: String! - The unique identifier of the project. Required

Returns:

Example:

query { subcomponents(projectId: "10000") { id name projectId isProjectcomponent after parentId description }

subcomponent

Fetches a specific subcomponent by its ID.

Arguments:

  • id: String! - The unique identifier of the subcomponent. Required

Returns:

Example:

query { subcomponent( id: "projectComponent-10000-10523" ) { id name projectId after isProjectComponent parentId } }

Mutation

saveFolder

Edit a folder.

Arguments:

  • id: String! - Updated Folder id.

  • projectId: String! - The unique identifier of the project.

Returns:

  • Folder - The saved or updated folder.

Example:

mutation { saveFolder ( projectId: "10000" name: "DevOps3" description: "DevOpsDescription3" ) { id after name parentId description } }

updateFolder

Edit a folder.

Arguments:

  • id: String! - Updated Folder id.

  • projectId: String! - The unique identifier of the project.

Returns:

  • Folder - The saved or updated folder.

Example:

mutation { updateFolder ( id: "4" projectId: "10000" name: "DevOps2" description: "DevOpsDescription" ) { id after name parentId description } }

deleteFolder

Delete a folder.

Arguments:

  • id: String! - Deleted Folder id.

  • projectId: String! - The unique identifier of the project.

Returns:

Example:

mutation { deleteFolder ( id: "f334af77-8862-4d38-9df0-3efc5356fc7c" projectId: "10344" ) { id name after parentId description } }

addSubcomponent

Adds a subcomponent to a subcomponent.

Arguments:

  • id: String! - The added subcomponent id. Required

  • projectId: String! - The unique identifier of the project. Required

  • parentId: String! - The id of new parent. Required

  • isVirtual: Boolean! - Type of added subcomponent. If subcomponent is folder, isVirtual parameter should be true. Required

Returns:

Example:

mutation { addSubcomponent ( id: "bbd740be-71a2-4f12-8d22-0d3d221210f1" projectId: "10291" parentId: "4e894373-cac1-4dbb-b80b-c0272b8eae5a" isVirtual: true ) { id, name } }

removeSubcomponent

Removes a subcomponent from its parent.

Arguments:

  • id: String! - The removed subcomponent id. Required

  • projectId: String! - The unique identifier of the project. Required

  • isVirtual: Boolean! - Type of added subcomponent. If subcomponent is folder, isVirtual parameter should be true. Required

Returns:

Example:

mutation { removeSubcomponent( id: "10510", projectId: "10291", isVirtual: false ) { id name after parentId isChild description isProjectComponent self } }

Types

Subcomponent

Represents a subcomponent within a project.

Fields:

  • id: String! - The unique identifier of the subcomponent.

  • name: String! - Name of the subcomponent.

  • projectId: String! - The unique identifier of the project.

  • isChild: Boolean! - If it is child subcomponent, isChild is true.

  • after: String! - Previous subcomponent id of subcomponent on project.

  • isProjectComponent: Boolean! - Value for checking subcomponent is project component.

  • parentId: String - The unique identifier of subcomponent’s parent.


Folder

Represents a saved folder within a project.

Fields:

  • id: String! - The unique identifier of the folder.

  • name: String! - The name of the folder.

  • projectId: String! - The unique identifier of the project.

  • after: String! - Previous subcomponent id of subcomponent on project.

  • isChild: Boolean! - If it is child subcomponent, isChild is true.

  • parentId: String - The unique identifier of subcomponent’s parent.

  • isProjectComponent: Boolean! - Value for checking subcomponent is project component.