improvements for plugins implementation #74
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Plugins V2:
Improves upon @dotansimha's v1 implementation based on the review given at #40
Features ✨
Introduce Global Plugins, which gets applied to every endpoint
Introduce a new hook
on_upstream_graphql_response
which modifies the response data before sending it to the client.Introducing our first useful plugin 🥁🥁🥁 "JSON Content Type Header", it intercepts the response from any source before it being sent to the client, and attaches the content type header, so that clients like Postman can show the result in a JSON format instead of being rendered as text. and It's applied as a default plugin.
Performance Improvements 🚀
Mutex
usage on theupstream
service, now it can handle requests concurrently instead of being blocked while the other request releases the lock.Arc
andRwLock
, resulting in a much faster access, eliminating write locks, and storing the plugins entirely on the Stack instead of the heap with the above eliminated smart pointers.