n1ru4l / envelop

Envelop is a lightweight library allowing developers to easily develop, share, collaborate and extend their GraphQL execution layer. Envelop is the missing GraphQL plugin system.
https://envelop.dev
MIT License
788 stars 128 forks source link

Add support for all graphql-rate-limit options #2276

Closed deggertsen closed 2 months ago

deggertsen commented 3 months ago

Description

Exposes all possible configuration fields and types to the rate-limiter plugin and forwards them to the underlying graphql-rate-limit function. This is as discussed in issue #2273. I've designed it to be backwards compatible so that it shouldn't break past versions, but all config should now be available through the graphQLRateLimitConfig prop.

Primary motivation is to expose the "store" prop so that Redis can be used.

Fixes #2273

Type of change

How Has This Been Tested?

This is a fairly simple change that shouldn't be breaking. I've tested locally by copying the plugin to my project and using the Redis store option. It seems to be working as expected.

Test Environment:

Checklist:

changeset-bot[bot] commented 3 months ago

🦋 Changeset detected

Latest commit: ab8fb0540fb49d3181a302f94287eb44d27978f2

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package | Name | Type | | --------------------- | ----- | | @envelop/rate-limiter | Patch |

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

deggertsen commented 3 months ago

I merged in your suggestion and fixed the spread of options to reflect that change.

I also added a changeset. Let me know if this should be a minor release instead of a patch release, but I think a patch seems right since there aren't any breaking changes.

Thanks for the feedback and recommendations! Let me know if there is anything else.