query-missing
The request leaves out its EventQL query.
- Routes:
run-eventql-query,write-events, andformat-eventql-query - Description:
query is missing: expected an EventQL querywhen running or formatting a query, andquery is missing: expected an EventQL query whose result is a booleanfor the query of anisEventQlQueryTrueprecondition - Details: For a precondition,
precondition, the place of the precondition in its list, counting from 0. On the other routes, none;detailsis an empty object.
Why It Happens#
Running a query takes it in query, and so does the payload of an isEventQlQueryTrue precondition. The request leaves out query, or sends it as an empty string. A query of nothing but whitespace is not missing: it goes to the parser, which reports it as query-malformed.
The route format-eventql-query belongs to the management UI, which formats the queries of its EventQL editor through it. It exists only while the management UI is enabled, with --with-ui, is not part of the stable API, and answers with a single envelope, the error itself, rather than a stream.
How to Fix It#
Send the query in query, and for a precondition, one that returns a single boolean. Sending the same request again fails the same way, since the error depends on the request alone.
Example#
To run a query with the body {}, EventSourcingDB answers with this error, as a line of the stream, and then ends the stream with its end item:
{
"type": "error",
"data": {
"code": "https://docs.eventsourcingdb.io/errors/query-missing",
"description": "query is missing: expected an EventQL query",
"details": {}
}
}