Skip to main content

Small GraphQL Doubt

  • July 31, 2020
  • 7 replies
  • 2477 views

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!!.

This topic has been closed for replies.

7 replies

LaurentConroux
  • Participating Frequently
  • July 31, 2020

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

if $columnId is already an array.

  • Community Expert
  • July 31, 2020

Hey @rohan ,

try it like that:

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

Greetings


  • Author
  • New Participant
  • July 31, 2020

AlexSavchuk
Forum|alt.badge.img
  • monday.com Team Member
  • August 1, 2020

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

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

-Alex


aquibk
  • Regular
  • February 10, 2021

@TMNXT-Dev and @LaurentConroux I am also getting the same error when I am trying to fetch by column values.
I have tried the above mentioned solution as well but still getting the same error.

.

Any suggestion would be appreciated…!


  • Community Expert
  • February 10, 2021

Hey @aquibk,

the items_by_column_values doesn’t accept Arrays.
This is why you get the “dimension mismatch”.

What I do in situations like this, I go to the API playground and look for the query/mutation I want to use.

And look for the definition in there:

Simply change:

$boardId: Int!

const vara = { boardId: boardId }

And make sure you pass an Integer and not an Array.
Adjust the other two parameters as well and it should work.

Greetings


  • February 19, 2021

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.