Data Models Annotations via GraphQL API
- 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.**
Our data models are defined in Cube, and our embedded analytics consume them dynamically via GraphQL API.
We would like their presentation to be dynamic as well. In order to know how to present each measure, we would like to provide extra metadata for each measure (such as different types formats - `currency` , and `percent` )
**Describe the solution you'd like**
This logic is already supported in REST API.
https://cube.dev/docs/reference/rest-api#v1load
for example
```json
"annotation": {
"measures": {
"users.count": {
"title": "Users Count",
"shortTitle": "Count",
"type": "number"
}
},
```
In regards to GraphQL endpoint, it would be best to request it as part of the request payload.
for example
1. Adding it to the `CubeQueryArgs`
2. Adding that as a separate query instead of `cube {...}` it can be `metadata {...}`
**Describe alternatives you've considered**
1. Calling both REST API and GraphQL, but it's less efficient.
**Additional context**
Started the question on Slack https://cube-js.slack.com/archives/C04NYBJP7RQ/p1695906487588799
Contributor guide
Assessment
This issue has not been assessed yet.