You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So I tried using this middleware with a graphQL API and I have been getting back a syntax error after the limit has been reached instead of a limit reached message. I am using gqlgen and based on their documentation, I should have been able to use this middleware without any issues, so I am not certain of what is causing my error of:
{
"error": "JSON.parse: unexpected character at line 1 column 1 of the JSON data"
}
This seems to return the proper response, but sometimes I see a signal: terminated message in my terminal when the limit has been reached, not sure if this is suppose to happen?
The text was updated successfully, but these errors were encountered:
I honestly don't know how GraphQL works and how you should respond, network wise, to propagate an error.
However, you should use WithLimitReachedHandler to override the default implementation.
With the error JSON.parse: unexpected character at line 1 column 1 of the JSON data I'm guessing that GraphQL expect a JSON, which isn't the case in the default handler, we simply return a plain text, that's why you have this error.
For your last point, I have no idea what you're talking about. This error is also cryptic, so without any investigation on your part, I'm afraid I can't help you.
So I tried using this middleware with a graphQL API and I have been getting back a syntax error after the limit has been reached instead of a limit reached message. I am using gqlgen and based on their documentation, I should have been able to use this middleware without any issues, so I am not certain of what is causing my error of:
when the limit is reached.
My code looks like this:
What should I do in this case?
Update:
This workaround seems to work:
This seems to return the proper response, but sometimes I see a
signal: terminated
message in my terminal when the limit has been reached, not sure if this is suppose to happen?The text was updated successfully, but these errors were encountered: