OperationCanceled Error in Graphql APIs

Hi Support,

We have been using Mongo Atlas App Service as a GraphQL service to access MongoDB for the last 5 - 6 months and APIs were working fine but in the last 15 days we have been getting “OperationCanceled Error” in apis sometimes so can you please check why we are getting this error sometime?

Our Org name is Neurologik

Thanks
Raman

Hi @Raman_Kumar,

The OperationCanceled error means typically what it says - the client, for whatever reason, has decided to cancel the request. This could have had different causes (explicit cancel, connection drop, …), but in general is not due to anything wrong on the backend side, it’s just an acknowledgment that the request was canceled.

There are other errors in your logs, that seem to point to some overlapping of queries and mutations, you may want to look into those as well.

Unfortunately, you’ve chosen to go for a single, API Key-based user, that, if clients are calling GraphQL directly, is both pretty bad for security (that type of API Key is meant to be used by servers, especially where mutations happen), and even worse for diagnostics, as it’s impossible to track whatever flow that particular client was following: if your app is indeed routed through a server you’ve control on, you may be in a better position to understand what happened there.