Tabular responses with dataTable
A graph represented as a JSON object can be a parsing challenge when the required data needs to be a table. To solve this use case for feedback and invitations, use the dataTable
node to optimize the response for formatting as a table. The response data structure allows getting the 3D array of values, where the
-
first index represents the row, the
-
second one represents the column, and the
-
third is used for indexing multiple values in potentially multi-valued fields.
Query
query {
feedback {
dataTable(definition: {
columns: [
{fieldId: "multivaluedField1"},
{fieldId: "field2"}
]}) {
values
}
}
}
Response
"data":{
"feedback":{
"dataTable": {
"values": [
/* Row 0 */
[
/* Columns */
[ "1", "2" ], /* multivaluedField1.values */
[ "4" ], /* field2.values */
],
/* Row 1 */
[
/* Columns */
[ "4", "1" ], /* multivaluedField1.values */
[ "7" ], /* field2.values */
]
]
...