When I add integration: lambda and authorizer it is throwing TypeError: event.path.endsWith is not a function error
graphql:
handler: handlers/graphql/handler.graphqlHandler
events:
- http:
path: graphql
method: post
cors: true
integration: lambda
authorizer:
arn: arn:aws:cognito-idp:${env:COGNITO_USER_POOL_ARN}
claims:
- email
- nickname
- http:
path: graphql
method: get
cors: true
As per my observation, without integration lambda and authorizer, I get event.path = {} whereas nornally it is '/'
dependency:
"apollo-server-lambda": "^2.22.2", "serverless": "2.31.0",
handler:
const { ApolloServer } = require('apollo-server-lambda');
import { dbConnect, models } from '../../db';
import { default as typeDefs } from '../../graphql/types';
import { default as resolvers } from '../../graphql/resolvers';
const createHandler = async () => {
const db = await dbConnect();
const server = new ApolloServer({
typeDefs,
resolvers,
context: { models, db }
});
return server.createHandler();
};
export const graphqlHandler = (event, context, callback) => {
createHandler().then(handler => handler(event, context, callback));
};
Expected:
Should not break with TypeError: event.path.endsWith is not a function error
When I add integration: lambda and authorizer it is throwing TypeError: event.path.endsWith is not a function error
As per my observation, without integration lambda and authorizer, I get event.path = {} whereas nornally it is '/'
dependency:
"apollo-server-lambda": "^2.22.2", "serverless": "2.31.0",handler:
Expected:
Should not break with TypeError: event.path.endsWith is not a function error