/
Attribute GraphQL Operations

Attribute GraphQL Operations

Table of Contents

 

Overview

This document provides an overview of the GraphQL API for managing attributes and attribute values. It includes the available queries and mutations, as well as the types used in the API.

Schemas

Query

attributes

Fetches attributes.

Returns:

Example:

query { attributes { id name category options active relatedAttributes required active defaultValue description } }

attributeValues

Fetches all attribute values for a given project and type.

Arguments:

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

  • type: String! - Type of the attribute value. It can be only “project” | “component” |“version” Required

Returns:

Example:

query { attributeValues(projectId: "10000", type: "component") { projectId componentId versionId attributeTypeId stringValue integerValue floatValue } }

attributeValuesByAttributeId

Fetches all attribute values for a given project and attribute ID.

Arguments:

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

  • attributeId: String! - The unique identifier of the attribute Required

Returns:

Example:

query { attributeValues(projectId: "10000", type: "attributeType-1234-5678") { projectId componentId versionId attributeTypeId stringValue integerValue floatValue } }

attributeValuesByCategory

Fetches all attribute values for a given project and category.

Arguments:

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

  • category: AttributeCategory - One of the category of attribute type Required

Returns:

Example:


attributeValuesByName

Fetches all attribute values for a given project and attribute type name.

Arguments:

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

  • name: String! - Name of the attribute type Required

Returns:

Example:

Mutation

saveAttribute

Saves a new attribute or updates an existing one.

Arguments:

Returns:

Example:


saveAttributeValues

Save attribute value for given component, version or project

Arguments:

  • attributeValues: [AttributeValueInput] - An array of attribute values.Required

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

  • type: String! - Type of the attribute value. It can be only “project” | “component” | “version”Required

Returns:

Example:


deleteAttribute

Deletes a specific attribute by its ID.

Arguments:

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

Returns:

  • String! - A message indicating the result of the deletion.

Example:


deleteAttributeValue

Deletes a specific attribute value by its ID.

Arguments:

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

Returns:

  • String! - A message indicating the result of the deletion.

Example:


  • String! - A message indicating the result of the deletion.


Types

AttributeType

Represents a attribute.

Fields:

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

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

  • category: String! - The category of the attribute type. (SINGLE_SELECT, DURATION etc.)

  • description: String - A description of the attribute type.

  • active: Boolean! - Indicates if the attribute type is active.

  • required: Boolean! - Indicates if the attribute type is required.

  • options: [String] - Indicates if the attribute type is single select and has options.

  • relatedAttributes: [String]! - The related types included in the attribute. (Project, component or version)


AttributeCategory

Represents the category of an attribute.

Fields:

  • BOOLEAN - Represents a boolean attribute type.

  • DURATION - Represents a duration attribute type.

  • TEXT - Represents a text attribute type.

  • INTEGER - Represents a integer attribute type.

  • DECIMAL - Represents a decimal attribute type.

  • SINGLE_SELECT - Represents a single select attribute type.


AttributeTypeInput

Input type for saving attribute.

Fields:

  • id: String - The unique identifier of the attribute type.

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

  • category: String! - The category of the attribute type. (SINGLE_SELECT, DURATION etc.)

  • description: String - A description of the attribute type.

  • active: Boolean! - Indicates if the attribute type is active.

  • required: Boolean! - Indicates if the attribute type is required.

  • options: [String] - Indicates if the attribute type is single select and has options.

  • relatedAttributes: [String]! - The related types included in the attribute. (Project, component or version)


AttributeValue

Represents a attribute value.

Fields:

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

  • componentId: String - The unique id of component if type is component.

  • versionId: String - The unique id of the version if type is version.

  • attributeTypeId: String! - The unique id of the attribute type.

  • stringValue: String - Indicates string value of attribute value

  • integerValue: Int - Indicates string value of attribute value if attribute type is duration or integer.

  • floatValue: Float - Indicates string value of attribute value if attribute type is decimal.


AttributeValueInput

Input type for saving attribute value.

Fields:

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

  • componentId: String - The unique id of component if type is component.

  • versionId: String - The unique id of the version if type is version.

  • attributeTypeId: String! - The unique id of the attribute type.

  • stringValue: String - Indicates string value of attribute value

  • integerValue: Int - Indicates string value of attribute value if attribute type is duration or integer.

  • floatValue: Float - Indicates string value of attribute value if attribute type is decimal.