Responding to Alerts

So your GraphQL server is sending back data you didn't expect. You've got a big scary error in Slack like this: OnlineOrNot Alert - Data mismatch Or this: OnlineOrNot Alert - Timeout

You're probably wondering how to use OnlineOrNot to figure out why. Here's how:

Alerts

All alerts that OnlineOrNot sends to Slack will contain a link (the blue text starting with [FIRING]) to the result containing further information.

First log in, then click on the link in Slack.

Data Mismatch

Data mismatches can be caused by a wide range of reasons - from colleagues updating GraphQL resolvers to meet new business requirements, to the library that you use to format dates changing its default output from YYYY-MM-DD to DD-MM-YYYY.

Clicking on the link in Slack will take you to the following page: OnlineOrNot Test Result

At the bottom of this page you'll see the comparison between the Expected Result, and the Observed Result of the GraphQL test: OnlineOrNot Test Result Data Comparison

How to interpret the comparison

The comparison field contains three keys: differentResult, missingFromExpectedResult, and missingFromObservedResult.

  • The differentResult key lists all fields that had a value that changed between the Expected Result and the Observed Result
  • The missingFromExpectedResult key lists all fields that have been added since the original snapshot was taken of the GraphQL result.
  • The missingFromObservedResult key lists all fields that you expected to be in the GraphQL result, but for some reason the GraphQL server did not respond with (this situation is incredibly rare if your GraphQL server is compliant to the GraphQL specification).

At this point you should be able to jump into your code and figure out what's happening with the GraphQL resolver.

Timeouts

If your timeout value in your GraphQL Test Settings is set quite low (<5000ms), you'll likely get the TIMEOUT alert quite often.

Typically I set my timeout value to between 10000ms and 15000ms depending on how heavy the GraphQL query is.

On the off-chance that your timeout is already large - you've most likely got yourself an infrastructure problem.

GraphQL timeouts can occur for a wide range of reasons:

  • If one of your resolvers uses a third party service to fetch data, your third party could be timing out, causing your server to also time out
  • If your DNS settings have changed, your server may not be reachable from the wider internet
  • If your database is running out of memory or storage, it could be struggling to return your queries