Skip to content
Developerhome

Operator to get a single custom property value

  Less than to read

A custom property can be extracted from _customField.

After extraction, it is possible ot rename the property as the user wishes. For example:

marketingDate: _customDate(selector:  "marketingDate")

The following table displays the resulting query following the above rename:

{ 
  xtremMasterData{ 
    item{ 
      query (filter: "{_customData: { _ne: null}}"){ 
        edges { 
          node { 
            id 
            marketingDate:_customData(selector:"marketingDate") 
          } 
        } 
      } 
    } 
  } 
} 
{ 
  "data": { 
    "xtremMasterData": { 
      "item": { 
        "query": { 
          "edges": [ 
            { 
              "node": { 
                "id": "PIE_BLUEBERRY", 
                "marketingDate": "\"2023-08-17\"" 
                } 
            }
          ] 
        } 
      } 
    } 
  }, 
  "extensions": { 
    "diagnoses": [] 
  }
} 

Custom fields, regardless ot their data type, are always presented as strings. This is a GraphQL related constraint.

A developer who wants to get the value of a custom field without using quotes should use a function such as JSON.parse in Javascript.