Skip to content
Developerhome

Order By

  Less than to read

It is possible to apply OrderBy to custom fields.

The following table displays an example of how OrderBy is applied to a custom field:

{ 
  xtremMasterData { 
    item { 
      query( 
        filter: "{\"_customData\":{\"marketingDate\":{\"_eq\":\"2023-08-17\"}}}" 
        orderBy: "{\"_customData\":{\"rating\":-1}}", 
        first: 30 
      ) { 
        edges { 
          node { 
            id 
            _customData 
          } 
        } 
      } 
    } 
  } 
}   
{ 
  "data": { 
    "xtremMasterData": { 
      "item": { 
        "query": { 
          "edges": [ 
            { 
              "node": { 
                "id": "011000", 
                "_customData": "{\"rating\":54,\"marketingDate\":\"2023-08-17\"}" 
              } 
            }, 
            { 
              "node": { 
                "id": "PIE_BLUEBERRY", 
                "_customData": "{\"rating\":28,\"marketingDate\":\"2023-08-17\"}" 
              } 
            } 
          ] 
        } 
      } 
    } 
  }
}