hi @aquibk
I am using this function to do just that (returning also few other fields)
static async getBoardColumns(token, boardId) {
try {
const mondayClient = initMondayClient({ token });
const query = `query($boardId: [Int]) {
boards (ids: $boardId) {
columns {
id
title
type
settings_str
}
}
}`;
const variables = { boardId };
const response = await mondayClient.api(query, { variables });
this.checkThrowError(variables, response, token);
return response.data && response.data.boards[0] ? response.data.boards[0].columns : false;
} catch (err) {
console.log(err);
return false;
}
}
When calling this function make sure you pass an Int value as the boardId. I always parseInt all board and item id’s just to be on the safe side.