Queries
The query endpoint accepts a query request, containing expressions to be evaluated in the context the data source, and returns a response consisting of relevant rows of data.
The structure and requirements for specific fields listed below will be covered in subsequent chapters.
Request
POST /query
Request
See QueryRequest
Request Fields
| Name | Description |
|---|---|
collection | The name of a collection to query |
query | The query syntax tree |
arguments | Values to be provided to any top-level collection arguments |
collection_relationships | Any relationships between collections involved in the query request |
variables | One set of named variables for each rowset to fetch. Each variable set should be subtituted in turn, and a fresh set of rows returned. |
request_arguments | Values to be provided to any request-level arguments, defined in the query_arguments section of the schema response. |
Response
See QueryResponse
Requirements
- If the request specifies
variables, then the response must contain oneRowSetfor each collection of variables provided. If not, the data connector should respond as ifvariableswere set to a single empty collection of variables:[{}]. - If the request specifies
fields, then the response must containrowsaccording to the schema advertised for the requestedcollection. - If the request specifies
aggregatesthen the response must containaggregates, with one response key per requested aggregate, using the same keys. See aggregates. - If the request specifies
arguments, then the implementation must validate the provided arguments against the types specified by the collection's schema. See arguments.