Quantcast
Viewing all articles
Browse latest Browse all 2

Cannot get functions from apollo-server-express

I am following the tutorial and trying to start node server and i cant import this to functions from Apollo package

const {graphqlExpress, graphiqlExpress} = require('apollo-server-express'); // here i importing fucntionsconst bodyParser = require('body-parser'); // import parserconst cors = require('cors'); // import corsconst express = require('express'); // import corsconst { makeExecutableSchema } = require('graphql-tools');const port = 9000; // define portconst schema = makeExecutableSchema({typeDefs, resolvers}); // init shcemaconst app = express();app.use(cors(), bodyParser.json());app.use('/graphql', graphqlExpress({schema})); // is not a functionapp.use('/graphiql', graphiqlExpress({endpointUrl: '/graphql'})); // is not a functionapp.listen(port, () => console.log(`Server is running on the port ${port}`));

When i starting the server if fails due to "graphqlExpress is not a function", and when it commented and the server restarted the same thing about graphiqlExpress. Maybe the tutorial i am following is outdated and apollo-server-express doesnt provide such functions anymore?


Viewing all articles
Browse latest Browse all 2

Trending Articles