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:
[Subcomponent] - An array of subcomponents.
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:
[Subcomponent] - A subcomponent.
Example:
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:
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:
deleteFolder
Delete a folder.
Arguments:
id: String!
- Deleted Folder id.projectId: String!
- The unique identifier of the project.
Returns:
Folder - The deleted folder.
Example:
addSubcomponent
Adds a subcomponent to a subcomponent.
Arguments:
id: String!
- The added subcomponent id. RequiredprojectId: String!
- The unique identifier of the project. RequiredparentId: String!
- The id of new parent. RequiredisVirtual: Boolean!
- Type of added subcomponent. If subcomponent is folder, isVirtual parameter should be true. Required
Returns:
Folder - The added folder.
Subcomponent - The added subcomponent.
Example:
removeSubcomponent
Removes a subcomponent from its parent.
Arguments:
id: String!
- The removed subcomponent id. RequiredprojectId: String!
- The unique identifier of the project. RequiredisVirtual: Boolean!
- Type of added subcomponent. If subcomponent is folder, isVirtual parameter should be true. Required
Returns:
Folder - The added folder.
Subcomponent - The added subcomponent.
Example:
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.