Order Response

In Zoho CRM GraphQL APIs, results of the response data set of _Records type can be ordered using order_by clause. Each {module}__connection supports {module}__OrderBy type argument. In each {module}__OrderBy type, a list of all supported fields for sorting are represented. For example, Products__Connection supports Products__OrderBy.

Products__OrderBy

Copiedinput Products__OrderBy {
Qty_in_Demand: _OrderByClause
Product_Category: _OrderByClause
Description: _OrderByClause
Tax: _OrderByClause
Sales_Start_Date: _OrderByClause
Product_Active: _OrderByClause
Product_Code: _OrderByClause
Manufacturer: _OrderByClause
id: _OrderByClause
Support_Expiry_Date: _OrderByClause
Modified_Time: _OrderByClause
Created_Time: _OrderByClause
Commission_Rate: _OrderByClause
Product_Name: _OrderByClause
Support_Start_Date: _OrderByClause
Record_Status__s: _OrderByClause
Usage_Unit: _OrderByClause
Qty_Ordered: _OrderByClause
Locked__s: _OrderByClause
Qty_in_Stock: _OrderByClause
Tag: _OrderByClause
Sales_End_Date: _OrderByClause
Unit_Price: _OrderByClause
Reorder_Level: _OrderByClause
Taxable: _OrderByClause
}

_OrderByClause

Copiedinput _OrderByClause {
order: _ResultOrder
}

_ResultOrder

Copiedenum _ResultOrder {
ASC
DESC
}

Order by Example

Sample Request

Copiedquery {
    Records {
        Contacts(
            where: { and: [{ Last_Name: { like: "D%" } }] }
            order_by: { Last_Name: { order: ASC } }
        ) {
            _data {
                Last_Name{
                    value
                }
                Email{value}
                id{value}
            }
            }
        }
    }

Response

Copied{
    "data": {
        "Records": {
            "Contacts": {
                "_data": [
                    {
                        "Last_Name": {
                            "value": "Darakjy (Sample)"
                        },
                        "Email": {
                            "value": "joesphine-darakjy@noemail.com"
                        },
                        "id": {
                            "value": "111111000000062567"
                        }
                    },
                    {
                        "Last_Name": {
                            "value": "Dilliard (Sample)"
                        },
                        "Email": {
                            "value": "leota-dilliard@noemail.com"
                        },
                        "id": {
                            "value": "111111000000062573"
                        }
                    }
                ]
            }
        }
    }
}