jetstreamapp/soql-parser-js

If an empty orderby array is included, the composed query is invalid

paustint opened this issue · 0 comments

  • Feature
  • Bug Request

Description

If an empty array is provided when composing a query, then ORDER BY should be omitted from the query.

The following query results in an invalid generated query:

{
  "fields": [
    {
      "type": "Field",
      "field": "Id"
    }
  ],
  "sObject": "Account",
  "orderBy": [],
  "limit": 1,
  "offset": 5
}
SELECT Id
FROM Account
ORDER BY 
LIMIT 1
OFFSET 5