Items_count returns a cached value

Hello!

I’ve an issue with the items_count query. I’m using the following query to create an item on my board:

    mutation (
      $boardId: ID!
      $itemName: String!
      $columnValues: JSON
      $groupId: String
    ) {
      create_item(
        board_id: $boardId
        item_name: $itemName
        column_values: $columnValues
        group_id: $groupId
      ) {
        id
      }
    }

Then, in my app, I’m polling the items_count with this query:

    query ($boardId: ID!) {
      boards(ids: [$boardId]) {
        items_count
      }
    }

The problem is, this query returns the amount of items from before I added a new one, just as if I was getting a cached response. The only way to solve it is to add a random item manually through your website. Then it counts the item I’ve added through the API and the new one.

Seems like adding an item through your website resets the “cache” you keep for the board, while doing it through the API doesn’t.

image

Hello there @kryptopaul and welcome to the community!

I hope you like it here :muscle:

I could not reproduce the issue. I am creating an item via API and then checking the items_count field and the new item is there. If I do it more times, each time the number changes.

I also tried adding the “item_count” field in the mutation (for the data I get as a response) and it gets updated there as well.

Would you be able to please fill this form so our team can take a look into this? Please add as much detail about your case as possible. If you can add a screen recording showing your entire script and you running it, even better.

Looking forward to hearing from you via the form!

Cheers,
Matias

1 Like