i have a problem with the apollo-server context. I wrote the following code:
const { ApolloServer } = require("apollo-server-azure-functions");
const { typeDefs, resolvers } = require('../graphql_schema/schema');
const server = new ApolloServer({
typeDefs,
resolvers,
context: ({ req }) => {
console.log(req);
return {
req: req
}
},
introspection: false,
playground: true,
});
module.exports = server.createHandler();
Run Code Online (Sandbox Code Playgroud)
But the req variable is always undefined. Does anybody have a idea?
I´m using following versions of apollo
"apollo-server": "^2.4.2",
"apollo-server-azure-functions": "^2.4.2",
Run Code Online (Sandbox Code Playgroud)
Thank you very much.