Core
Framework v2.x
2

query #

Sends an API request to Kuzzle. This is a low-level method, used by all the controllers of the SDK.

It overrides the query method of the Javascript SDK.

Arguments #

query(request: BaseRequest, options?: { propagate?: boolean }): Promise<ResponsePayload>

ArgumentTypeDescription
request
RequestPayload
API request
options
JSONObject
Optional arguments, see the query method of the Javascript SDK

options:

PropertyType (default)Description
propagate
boolean

(false)
For realtime:subscribe requests only: if true, the notification callback is executed on every node of the cluster

Returns #

Returns a promise resolving to the API response.

Throws an api.process.forbidden_embedded_sdk_action error for the auth actions an embedded SDK cannot call (see the EmbeddedSDK properties page).

Usage #

const response = await app.sdk.query({
  controller: 'server',
  action: 'now',
});