Tutorial: How to build a GraphQL server
Jonas Helfer

HI, I got a problem.
As I set up my apollo engine as this article and i run my server.

My editor show this up
`TypeError: Cannot read property ‘middlewareParams’ of undefined`

And here is my code, help plz.

const express = require(‘express’);
const bodyParser = require(‘body-parser’);
const { graphqlExpress, graphiqlExpress } = require(‘apollo-server-express’);
const compression = require(‘compression’);
const { Engine } = require(‘apollo-engine’);
const app = express();
const engine = new Engine({
 engineConfig: {
 apiKey: /* API key*/,
 graphqlPort: process.env.PORT || 3000,
 dumpTraffic: true,
 startupTimeout: 5000,
app.use(engine.expressMiddleware); // must be first middleware
const buildOptions = async (req, res) => {
 return {
 tracing: true,
 cacheControl: true,
 bodyParser.urlencoded({ extended: false }),
app.use(‘/graphiql’, graphiqlExpress({ endpointURL: ‘/graphql’ }));
app.listen(3000, () =>
 `GraphiQL is now running on http://localhost:3000/graphiql`
module.exports = app;
Like what you read? Give 吳啟碩 a round of applause.

From a quick cheer to a standing ovation, clap to show how much you enjoyed this story.