-
Notifications
You must be signed in to change notification settings - Fork 64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No documentation on how to use GqlThrottlerGuard with Subscription #1110
Comments
GraphQL Subscriptions, like general websockets, act a little bit differently. Can you get me a reproduction with subscriptions enabled and I can work on the documentation of how to make it work with the throttler? |
@jmcdo29 it is just a matter of Unfurtunutelly i have no time at this moment f time to build repro code. But it is a matter of 1 resolver and GQL module from Nest.JS. I can drop you some code that might speed your repro:
and
|
I am running into a similar issue where all Query, Mutation operations are fine but the |
@aliabbasrizvi you'd need to find a reliable way to allow for writing headers of the websocket. The error comes from around here. If you can get a reproduction I can probably find something to use here |
For those who are facing the issue like @aliabbasrizvi, you just need to put |
Simply adding this to the GraphQLModule configuration works, maybe this should be added to the ReadMe and this problem should be closed @jmcdo29 :) |
@jmcdo29 any update?
Throw
Throw error Is there an example to set GqlThrottlerGuard with subscriptions |
As I said, if someone can get me a reproduction I can better look into it. I haven't tried to look into rate limiting subscriptions as I don't use gql much |
Is there an existing issue that is already proposing this?
Is your feature request related to a problem? Please describe it
I am using global throttler guard for my graphql api. But I get an error when I am adding subscriptions
"Cannot read properties of undefined (reading 'ip')",
It is thrown bu GqlThrottlerGuard
Describe the solution you'd like
It would be great to have section in documentation here: https://docs.nestjs.com/security/rate-limiting#graphql how to handle it. I had to dig into your github code to see that there is a
@SkipThrottle()
decoratorTeachability, documentation, adoption, migration strategy
No response
What is the motivation / use case for changing the behavior?
The text was updated successfully, but these errors were encountered: