Iql Function
proxima:iqlFunction
allows your application to define a custom IQL function that can be used in any feature where IQL can be configured.
Manifest Example
manifest.yml
modules:
proxima:iqlFunction:
- key: iql-function-key
name: myIqlFunction
function: iql-function-execute
function:
- key: iql-function-execute
handler: iql.executeIqlFunction
Properties
name | type | required | description |
---|---|---|---|
key | String | Yes | A key for the module, which other modules can refer to. Must be unique within the manifest. Regex: ^[a-zA-Z0-9_-]+$ |
name | String | Yes | The name of the IQL function, used in IQL |
function | String | Yes | A reference to the function module that defines the function |
Function Definition
interface IPayload {
field: string;
operator: string;
arguments: any[];
}
export const executeIqlFunction = ({ payload }: { payload: IPayload }) => {
const { field, operator, arguments } = payload;
// For example, for this IQL: status in myIqlFunction("arg1", "arg2")
// The parameters obtained in the IQL function are as follows:
// field: status
// operator: in
// arguments: ["arg1", "arg2"]
// your code
return { iql }; // Return a new IQL
}
Usage
You can directly use the IQL function in the IQL input: