Options

New accounts not present through API

FrozenKiwiFrozenKiwi Member Posts: 3

Hey,

I'm having trouble accessing newly created accounts. I fetched my company data using a standard query and originally all the accounts came through - including custom ones I had created.

However, I later added a few more accounts, and these do not appear when using the same fetch-all query. I've tried creating other accounts of types similar to those that have appeared (eg credit card/loan) but these accounts don't appear either. I also tried simpler names, waiting a day etc, but no dice.

Thinking it may be a caching issue, I tried manually setting an ID on the newly created account, but when sending a mutation with my manual ID set on for the anchor it reports "Account not found".

Is there some kind of delay after creating an account for it to accessible in the API?

(the account part of) My query is:

      accounts {
        edges {
          node {
            id
            name
            description
            displayId
            type {
              name
              normalBalanceType
              value
            }
            subtype {
              name
              description
            }
            normalBalanceType
            balance
          }
        }
      }

Comments

  • Options
    dacklanddackland Member, Administrator, Moderator Posts: 25 admin

    Hello @FrozenKiwi ,

    The accounts list is paginated with a default pageSize of 45. Have you tried increasing the pageSize, like this?

    accounts(pageSize:100) {
      edges {
        node {
          name
        }
      }
      pageInfo{
        currentPage
        totalPages
        totalCount
      }
    }
    

    You could also fetch the 2nd page with the page parameter, or filter down the list with types, subtypes, etc. The full list of options is in the API Reference under accounts.

    Let me know if this works.

    Thanks,
    Daniel

  • Options
    FrozenKiwiFrozenKiwi Member Posts: 3

    Oh gosh, yes of course that's it.

    Many thanks, that's all I need!

Sign In or Register to comment.