Catalog Attribute — Create (GraphQL)
Creates a new product attribute. The code must be unique and pass the code rule (letters, digits, underscore) and may not be a reserved word. code, adminName, and type are required. For select, multiselect, and checkbox types you may supply options; per-locale labels go under each option's translations. The mutation returns the full attribute detail.
See the Attributes overview for how attributes, options, and families fit together.
The nested options and their translations are not returned on the mutation payload — re-query adminAttribute to read them back.
Validation and the regex pattern
validation names the rule a value must satisfy — numeric, email, decimal, url or regex. Choosing regex makes regex required, and the pattern is checked before it is stored.
A pattern must be delimited with /, may carry only the i, m, s and u modifiers, and must compile. That is narrower than PHP alone accepts because the same pattern is also written into the storefront's own form rules, where a # delimiter or a PCRE-only modifier would break the form for every product using the attribute. A pattern that does not qualify is refused rather than stored.

