-
Notifications
You must be signed in to change notification settings - Fork 198
Closed
Labels
p3Priority 3Priority 3
Description
Problem
The limit property is defined as a string for the WriteQuery type:
Which is used for creating a query:
But limit is defined as a number for the IRequestRunQuery type:
Which is used for running a previously created query:
Discussion
It's confusing why one needs to pass "3" when creating a query but 3 when running it.
When you create and run a query at once (i.e. run it inline):
You also need to use a number:
Also, passing in a number when creating a query just works, despite the type being a string.
const params: Partial<IWriteQuery> = {
model: ...,
view: ...,
fields: [...],
// @ts-ignore
limit: 3 // <--- this should be a string according to types but a number works fine
};
const query = await sdk.ok(sdk.create_query(params));
const runParams: IRequestRunQuery = {
query_id: 1,
}
const result = await sdk.ok(sdk.run_query(runParams));What's going on here? Why is limit a string anywhere at all?
Metadata
Metadata
Assignees
Labels
p3Priority 3Priority 3