> For the complete documentation index, see [llms.txt](https://docs.ergonode.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.ergonode.com/graphql/query-examples/create-a-product-and-assign-modify-attributes-values.md).

# Create a product and assign / modify attributes values

{% hint style="info" %}
This mutation assumes that below already exists in the system:

* template with code `template`
* textarea attribute with code `description`
* textarea attribute with code `short_description`
* text attribute with code `text`
* `pl_PL` language is active
  {% endhint %}

{% hint style="info" %}
Note that each mutation is aliased (`create: (...)`).\
Aliasing is required if there are at least two same mutations in one batch - `productAddAttributeValueTranslationsTextarea` in this case.

For simplicity, all mutations have been aliased in the example but it'd also suffice to only alias duplicates.
{% endhint %}

```graphql
mutation {
  create: productCreateSimple(input: {sku: "new_product", templateCode: "template"}) {
    __typename
  }
  assignDescription: productAddAttributeValueTranslationsTextarea(
    input: {
      sku: "new_product"
      attributeCode: "description"
      translations: [{ value: "Długi opis", language: "pl_PL" }]
    }
  ) {
    __typename
  }
  assignShortDescription: productAddAttributeValueTranslationsTextarea(
    input: {
      sku: "new_product"
      attributeCode: "short_description"
      translations: [{ value: "Krótki opis", language: "pl_PL" }]
    }
  ) {
    __typename
  }
  assignText: productAddAttributeValueTranslationsText(
    input: {
      sku: "new_product"
      attributeCode: "text"
      translations: [{ value: "wartość", language: "pl_PL" }]
    }
  ) {
    __typename
  }
}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.ergonode.com/graphql/query-examples/create-a-product-and-assign-modify-attributes-values.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
