Skip to content

How to validate api key on gateway? #6774

Answered by glasser
BCantos17 asked this question in Q&A
Discussion options

You must be logged in to vote

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).

Replies: 1 comment 8 replies

Comment options

You must be logged in to vote
8 replies
@glasser
Comment options

@BCantos17
Comment options

@BCantos17
Comment options

@glasser
Comment options

@BCantos17
Comment options

Answer selected by BCantos17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants