The following code works, but if I remove the second call to loadData(), the table is just cleared, and no data is displayed. Am I doing something wrong?
document.getElementById('refresh').onclick= () => {
fetch('http://localhost:8080/v1/graphql', {
method: 'POST',
headers: { 'Content-Type': 'application/json'
},
body: JSON.stringify({ query: 'query MyQuery { scomexp { id fqdn objecttype } }' }), })
.then(res => res.json())
.then(res => {
d = res.data.scomexp;
handsontable.loadData(d);
handsontable.loadData(d);
});
}