Small GraphQL Doubt

Hello, monday.com community. I am trying to get the name of a column given its id and board id. My code is

query($boardId: [Int], $columnId: [String]) {
        boards(ids:$boardId){
          columns(ids:[$columnId]){
            title
          }
        }
      }
const variables = { boardId, columnId };
const response = await mondayClient.api(query, { variables });

I am facing the following error

{
[0]   errors: [
[0]     {
[0]       message: 'List dimension mismatch on variable $columnId and argument ids ([[String]]! / [String])',
[0]       locations: [Array],
[0]       fields: [Array]
[0]     }
[0]   ],
[0] }

Would appreciate any help. Thank You!!.

Did you try ```
columns(ids:$columnId){

if $columnId is already an array.
1 Like

Hey @rohan ,

try it like that:

const variables = variables: { boardId: [boardId], columnId: [columnId] }

Greetings

1 Like

Thank You, @TMNXT-Dev @LaurentConroux

1 Like

@TMNXT-Dev and @LaurentConroux - thanks for being on top of this! You guys rock.

@rohan I’m glad the community was helpful :slight_smile: Sorry we weren’t the first to resolve this!

-Alex