How can I request product properties - UniversalTypes - using the productsearch?
  • 29 Jun 2022
  • 1 Minute to read
  • Contributors
  • Dark
    Light

How can I request product properties - UniversalTypes - using the productsearch?

  • Dark
    Light

Article summary

UniversalTypes are located under features.universalTypes in the result of the productsearch.

Product properties are represented by UniversalTypes. A UniversalType always includes:

* code: unique 9-digit code,
* name
* persistedPath
* The full path of a UT, dash separated, e.g. UT05-MT05-ELEC-ST05-NVOL
* type: defines the possible values for a UniversalType, consists of several sub fields
* type, can be
* NUMERIC: contains only numbers
* TEXT: Some prosa information
* RANGE: Numbers within a defined range
* BOOLEAN: UTs with this type do not have a value, they are set or not set
* rangeMin, rangeMax: minimal and maximal possible values for RANGE UTs

query q1 {
  productsearch(query: "gkfi") {
    content {
      productDetails {
        descriptions {
          descriptionShort
        }
      }
      features {
        universalTypes {
          code
          name
          persistedPath
          type {
            type
            rangeMin
            rangeMax
          }
        }
      }
    }
  }
}

These fields are not always filled:

  • value: A string or a number.
  • unit: The unit consists of several subfields.
  • code: the ProMaterial code of a unit, e.g. QM-METER
  • parent: The predecessor of the UniversalType
query q1 {
  productsearch(query: "gkfi") {
    content {
      productDetails {
        descriptions {
          descriptionShort
        }
      }
      features {
        universalTypes {
          name
          code
          value
          unit {
            code
            name
            symbol
          }
          parent {
            name
            code
            value
          }
        }
      }
    }
  }
}

For more details see the docs in the GraphiQL UI of your DistributionGate:

https://[your-code].prod.promaterial.com/api

and / or check this article: What are the most-used UniversalTypes?


Was this article helpful?