Skip to content

v3 apollo-server-lambda missing {event} in context function? #5476

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

You must be logged in to vote

Ah, I see what's happening here. I think this does work at the JS level but not at the TS level.

The base ApolloServer class from apollo-server-core declares that its context function takes a loosely typed argument (any). The ApolloServer class in apollo-server-express overrides the constructor just to note that its context function takes a well-typed argument (and apollo-server which is built on apollo-server-express uses the same typing). The other random integrations keep the loosely typed base declaration.

However, starting with Apollo Server 3, apollo-server-lambda (and apollo-server-cloud-functions) inherit from apollo-server-express, so they get the Express constructor's typing, wh…

Replies: 1 comment 5 replies

Comment options

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

@glasser
Comment options

@cluedtke
Comment options

@glasser
Comment options

@cluedtke
Comment options

Answer selected by cluedtke
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