absinthe_rate_limiting
is a middleware-based rate limiter for
Absinthe that uses
Hammer.
absinthe_rate_limiting
is available in
Hex, and can be installed by adding
:absinthe_rate_limiting
to your list of dependencies in mix.exs
:
def deps do
[
{:absinthe_rate_limiting, "~> 0.1.0"}
]
end
To use the rate limiting middleware, you must first configure Hammer. See the Hammer documentation for more information.
The next step is to add the middleware to the query that needs to be rate limited:
field :my_field, :string do
middleware AbsintheRateLimiting.RateLimit
resolve &MyApp.Resolvers.my_field/3
end
For the full usage information, see AbsintheRateLimiting.RateLimit
.