You now have to use WebApp to create the server. This is what we do.
// Allows Meteor to server API to /graphql
// The casting as unknown has to happen here. As meteor's WebApp is express basically but the types don't line up
server.applyMiddleware({
app: (WebApp.connectHandlers) as express.Application,
path: '/graphql',
})
// We are doing this work-around because Playground sets headers and WebApp also sets headers
// Resulting into a conflict and a server side exception of "Headers already sent"
WebApp.connectHandlers.use(
'/graphql',
(req: IncomingMessage, res: ServerResponse) => {
if (req.method === 'GET') {
res.end()
}
}
)
})