My Products
Help
Florian Haase
PARTNER

Timout on query

by Florian Haase

Hi,

 

following query is timing out:

 

query{useCompany(no: 2136125){accountingTransaction(filter: {createdDateTime: {_gte:"2020-01-01T00:00:00Z"}},after:"OTUwMDAw", first: 5000) {totalCount pageInfo{hasNextPage startCursor endCursor} items{accountingYearAndPeriod accountNo additionalText changedDateTime createdDateTime cid creditAmountInCurrency creditedAmountDomestic currencyNo debitAmountInCurrency debitPostedAmountDomestic free1 orgUnit1 orgUnit2 text voucherNo voucherType voucherJournalNo auditNo}}}}

 

the same query for the previous pages went well but I'm struggling a bit here with the error handling since I'm working in a datawarehouse solution which just would stop on a 4xx or 5xx response. The GraphQL still reports 2XX even it is timing out.

 

Florian

 

3 REPLIES 3

by Marius Bancila

The query, in a readable form:

query
{
  useCompany(no: 2136125)
  {
    accountingTransaction(
      filter: {createdDateTime: {_gte:"2020-01-01T00:00:00Z"}},
      after:"OTUwMDAw",
      first: 5000)
    {
      totalCount
      pageInfo
      {
        hasNextPage
        startCursor
        endCursor
      }
      items
      {
        accountingYearAndPeriod
        accountNo
        additionalText
        changedDateTime
        createdDateTime
        cid
        creditAmountInCurrency
        creditedAmountDomestic
        currencyNo
        debitAmountInCurrency
        debitPostedAmountDomestic
        free1
        orgUnit1
        orgUnit2
        text
        voucherNo
        voucherType
        voucherJournalNo
        auditNo
      }
    }
  }
}

GraphQL response with 200 even when errors or timeouts occur, as described here: https://docs.business.visma.net/docs/features/errors.

 

I don't know the reason for this, it could probably be traced in our logs if you contact support.

 

You could try to reduce the number of fetched items to 1000 or less and see if it still times out.

 

For long running operations that could potentially timeout, we have support for asynchronous queries: https://docs.business.visma.net/docs/schema/async.

 

Florian Haase
PARTNER

1) Async query is not an option since the integration platform does not support that

2) I will test to reduce the number of items per page, but not ideal due to a expected number of total rows over 1 mill

3) I'm aware of this 200 handling, I just wanted to discuss that this causes some interesting problems when using tools which are expecting that 200 really means that things went ok

 

Florian

 

Accepted solution
Marius Bancila
VISMA

The 200 status code is not our option. This is what all GraphQL implementations do. It's built-in the GraphQL framework we are using.