cube-js / cube-js/cube

Vue's query builder should use alternative order format

Open
#7,217 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
20.8k
Forks
2.1k
Avg merge
1d 2h
Merged PRs (30d)
181

Description

**Is your feature request related to a problem? Please describe.**
Vue's query builder does not use nor support the [alternative order format](https://cube.dev/docs/product/apis-integrations/rest-api/query-format#alternative-order-format). Right now it works with an object which is not ideal when you want to be able to control the ordering of the order. It relies on the order of keys in said object... so unless you stringify both old and new order you have no chance of observing a change.

**Describe the solution you'd like**
I would like Vue's query builder to also use the alternative order format like React's query builder used in the playground. It will give us more control over the order than just relying on the object with the unreliable order of keys and stringification of the order objects.

**Describe alternatives you've considered**
Don't see any alternative other than adding support or outright using the alternative order format in the builder.

**Additional context**
Example of a query generated from the playground (with the usage of the alternative order format) and from the Vue's builder
```js
// Playground
{
"measures": [
"TaskView.count"
],
"timeDimensions": [
{
"dimension": "TaskView.createdAt",
"granularity": "day"
}
],
"order": [
[
"TaskView.count",
"desc"
],
[
"TaskView.createdAt",
"asc"
]
],
"dimensions": [
"TaskView.type"
]
}

// Vue's builder
{
"measures": [
"TaskView.count"
],
"dimensions": [
"TaskView.type"
],
"timeDimensions": [
{
"dimension": "TaskView.createdAt",
"granularity": "day"
}
],
"limit": 10000,
"order": {
"TaskView.count": "desc",
"TaskView.createdAt": "asc"
}
}
```

> both generated in the same order of steps to achieve them

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.