-
Have an Apollo Gateway app and cannot find a documentation on how to inspect the header in order to validate an API Auth Key and then based on that validation, allow the query to continue. There is a Seems like Is something like this possible? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 8 replies
-
One option is just to do this as a middleware in your Express (or whatever) app before the Apollo Server middleware. In theory, your context function might be a good place to do this, or requestWillStart, but I'll admit that error handling around these functions is not ideal in Apollo Server (especially in AS3; maybe a bit better in the forthcoming AS4). |
Beta Was this translation helpful? Give feedback.
One option is just to do this as a middleware in your Express (or whatever) app before the Apollo Server middleware.
In theory, your context function might be a good place to do this, or requestWillStart, but I'll admit that error handling around these functions is not ideal in Apollo Server (especially in AS3; maybe a bit better in the forthcoming AS4).