Kysoql
Reference

Troubleshooting

Work out whether a problem is in your schema, query, transport, or Salesforce.

Start by isolating the layer

Call compile() before execute(). If compilation fails, the problem is local to the query shape, generated schema, or values. If compilation succeeds but execution fails, look at the executor, authentication, API version, permissions, and Salesforce response.

When sharing a reproduction, include the smallest relevant query, generated schema fragment, sanitized error, and whether the query targets the API, static Apex, or dynamic Apex. Never include access tokens or production record data.

Installation and code generation

SymptomWhat to check
Unsupported Node versionKysoql requires Node.js >=22.12.0
kysoql: command not foundInstall @kysoql/codegen in the app and run its local binary through your package manager
Missing codegen authenticationConfigure auth in kysoql.config.* or provide a trusted --auth module
Unknown objectUse the object API name and confirm that the generation identity can query it
Missing relationship pathsInclude the related objects in codegen and regenerate
Invalid Describe responseCheck the transport, API version, and raw Salesforce response before changing types

Type errors

SymptomWhat it usually means
Field or path is rejectedIt is missing from the generated schema or lacks the capability required by that method
Date or time string is rejectedUse soqlDate, soqlDateTime, or soqlTime in ordinary filters
includes rejects a valueThe field needs generated active multipicklist values
Selected property is missingSelect it explicitly. $if selections are optional and parent relationships can be null
Aggregate result has no useful keyAdd .as(...) to row-producing aggregate selections
groupBy or aggregate selection is unavailableStart from an unselected root and group before selecting ordinary grouped fields
HAVING or ordering rejects an aliasUse the grouped field or aggregate expression rather than the selected alias
Methods disappear after .apex()Finish normal query structure before switching to the narrower Apex compile context
.execute() disappears after .apex()Apex builders compile SOQL only. Execute that query from Apex
Child .offset() is missingChild offset is intentionally under the pilot namespace

Compilation errors

ProblemFix
Empty selectionSelect at least one field or expression
Empty IN, NOT IN, or boolean groupHandle empty application inputs before building the predicate
Invalid LIMIT or OFFSETUse finite safe integers. Root offset is limited to 0..2000
Unbounded FIELDS(...)Use an allowed bounded API query or choose explicit fields
Duplicate selectionRemove the overlapping field, selector, or alias
Semi-join rejectedKeep supported semi-joins at the root WHERE level and within the documented count
Conflicting WITH clausesChoose one filtering WITH form for the query
Object requires a filterCheck support boundaries
FOR UPDATE conflictsRemove ORDER BY or ALL ROWS
clearGroupBy() failsRebuild the query without grouping-dependent selections or clauses
Child pilot offset failsThe immediate parent needs a literal LIMIT 1
Knowledge Apex bind is rejectedUse a supported literal Knowledge query shape

Execution problems

SymptomWhat to check
No query executor configuredPass an executor to Kysoql, or use the builder only for compile()
QueryAll or count is unsupportedThe executor must implement the matching optional capability
Native response errorInspect the sanitized Salesforce response metadata and paging locator
Query page or record budget exceededNarrow the query or deliberately raise the configured budget
Invalid JSforce resultConfirm that the adapter received a Salesforce query envelope with a record array
Incomplete response has no locatorFix the transport or test double instead of accepting truncated data
Child records look incompleteNative REST drains child locators. The JSforce adapter only drains root paging
Memory use is highexecute() collects root pages. Use explicit bounds or native REST async iteration
executeAll() returns deleted recordsQueryAll changes data visibility. Use ordinary execute() when that is not intended
Salesforce rejects typed SOQLCheck live metadata, permissions, API version, org features, and execution context

Do not convert transport failures into an empty array. That makes an outage look like a valid query with no matching rows.

Field filtering errors

Field-rule names must be exact Salesforce API names. include and exclude cannot be used together, include lists cannot be empty, and a rule cannot remove every described field.

If a field unexpectedly disappears, check which identity ran codegen. Permission changes can make a previously visible field unavailable. See field filtering.

selectFields() is unavailable

Any explicit field rule makes that generated object partial, even when the rule currently keeps every field. Kysoql disables selectFields(...) because Salesforce expands FIELDS(...) from live org metadata rather than your local subset.

Use explicit .select(...) calls, or remove the field rule and regenerate a complete schema.

On this page