absinthe_rate_limiting

Middleware-based rate limiting for Absinthe


Keywords
absinthe, absinthe-graphql, elixir
License
Other

Documentation

AbsintheRateLimiting

Hex.pm

absinthe_rate_limiting is a middleware-based rate limiter for Absinthe that uses Hammer.

Installation

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

Basic usage

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.