caluma
caluma copied to clipboard
feat(analytics): provide option labels
Analytics now gives you the ability to not only extract slugs from choice questions, but the corresponding labels as well.
Awesome @winged :tada:
Unfortunately the choice-questions are not correctly detected/handled and is_leaf
is true
. Here's part of the response as captured in the FE
{
"node": {
"id": "$SOME_ID",
"label": "chosenlabel",
"isLeaf": true,
"isValue": true,
"sourcePath": "document[foo].bar.baz",
"supportedFunctions": [
"VALUE",
"COUNT",
"MAX",
"MIN"
],
"__typename": "AvailableField"
},
"__typename": "AvailableFieldEdge"
},
Just as a heads up: The same should also be implemented for Form
. But this can also be done in a separate PR.
Awesome @winged tada
Unfortunately the choice-questions are not correctly detected/handled and
is_leaf
istrue
. Here's part of the response as captured in the FE{ "node": { "id": "$SOME_ID", "label": "chosenlabel", "isLeaf": true, "isValue": true, "sourcePath": "document[foo].bar.baz", "supportedFunctions": [ "VALUE", "COUNT", "MAX", "MIN" ], "__typename": "AvailableField" }, "__typename": "AvailableFieldEdge" },
Just as a heads up: The same should also be implemented for
Form
. But this can also be done in a separate PR.
Nice catch with the leaf/value detection! Fixed it and added a test.
I'll do the form one in a separate PR if you don't find anything else to fix here :-)
Awesome @winged :tada:
We're making progress. I can now add the label-field and also fetch the correct results. However, explicitly setting the language doesn't work yet:
{
"errors": [
{
"message": "de",
"locations": [
{
"line": 10,
"column": 3
}
],
"path": [
"analyticsTable",
"availableFields"
]
}
],
"data": {
"analyticsTable": {
"id": "QW5hbHl0aWNzVGFibGU6ZmFjaGluZm9ybWF0aW9uZW4=",
"availableFields": null,
"__typename": "AnalyticsTable"
}
}
}
@winged What's the status here?