Suppose I have a rating column with a maximum rating of 4. Let’s query the column and its value.
query {
boards {
columns (ids: "rating") {
id
title
type
settings_str
}
items {
id
column_values {
title
type
value
}
}
}
}
We would then get a response like
{
"boards":[
{
"columns":[
{
"id":"rating",
"title":"Rating",
"type":"rating",
"settings_str":"{\"limit\":4}"
}
],
"items":[
{
"id":"2379332173",
"column_values":[
{
"title":"Rating",
"type":"rating",
"value":"{\"rating\":4,\"changed_at\":\"2022-03-06T07:37:27.144Z\"}"
}
]
}
]
}
]
}
So far, so good. We’ve got a limit
of 4 and our current rating is 4, the maximum rating.
However, what if we change the column’s settings such that the maximum rating is now 3? Once we do, the rating is now 3 stars or hearts automatically since that’s the new max and we can’t possibly exceed the max. Okay, that’s expected and everything persists in the UI on refresh.
But, what does the same query give us as a response now?
{
"boards":[
{
"columns":[
{
"id":"rating",
"title":"Rating",
"type":"rating",
"settings_str":"{\"limit\":3}"
}
],
"items":[
{
"id":"2379332173",
"column_values":[
{
"title":"Rating",
"type":"rating",
"value":"{\"rating\":4,\"changed_at\":\"2022-03-06T07:37:27.144Z\"}"
}
]
}
]
}
]
}
Hm. We know the rating is 3 stars or hearts per our UI and the settings_str
confirms that the limit
is 3, yet the value
is 4. It looks like the backend wants to hold onto our old rating. Indeed, if we modify the column’s settings such that we have a max of 4 or 5, the rating is indeed 4 again without actually modifying the rating. The rating does indeed update in the API once you actually update the rating (UI, API).
Perhaps there’s an argument for this behavior in terms of retention, but it’s still unexpected to see a rating of 4 when the possible ratings might only be 1, 2 or 3.
Is this intended behavior going forward? While it likely doesn’t come up too frequently, it would be quite confusing when it does, especially as developers and users are often not the same.
settings_str
doesn’t have changed_at
like the column’s value
, so we can’t see if the rating exceeds the current max and then determine if the settings were changed after that rating was applied.