Skip to main content

Monday.api() function call doesn't return the same information as the playground

  • July 17, 2023
  • 3 replies
  • 325 views

Lafisrap

When I use monday.api() from the node module “monday-sdk-js” with the query

query {
    items (ids: [3298111887,4254562863,3286311905]) {
            name
    }
}

then I get only two items back:

"data": {
      "items": [
        {
          "name": "task #3"
        },
        {
          "name": "Ads"
        }
      ]
    },
    "account_id": 13449709
  }

When I do the same with GraphQL playground then I get all three:

{
  "data": {
    "items": [
      {
        "name": "task #3"
      },
      {
        "name": "Item 3"
      },
      {
        "name": "Ads"
      }
    ]
  },
  "account_id": 13449709
}

The items are on different boards. One of them is shared

CleanShot 2023-07-17 at 15.45.32@2x

And the shared one doesn’t appear. What could be the reason?

3 replies

basdebruin
  • Community Expert
  • July 17, 2023

hi @Lafisrap

One of the few things I can think of is that it could be permission related. The Playground runs under the credentials of the logged in user. The credentials of the app that holds the monday.api call depends on the token you use. Is this a view app or an integration?


Lafisrap
  • Author
  • New Participant
  • July 18, 2023

It’s an app with an Item view feature. We call the api from the backend with the token, that we obtain from the oauth process.


Lafisrap
  • Author
  • New Participant
  • July 18, 2023

Thanks for your hint. We found the issue. It was a missing ‘workspace-read’ scope. Not sure why though, but now we get the board.