I'm following the very basic tutorial in GraphQL Federations and trying to run an Apollo Servers as below:
const { ApolloServer } = require("apollo-server");
const { ApolloGateway } = require("@apollo/gateway");
const gateway = new ApolloGateway({
serviceList: [
{ name: "integrations", url: "http://localhost:5000/integrations" },
// List of federation-capable GraphQL endpoints...
]
});
const server = new ApolloServer({ gateway });
server.listen().then(({ url }) => {
console.log(` Server ready at ${url}`);
});
But I am constantly hitting an error of Class constructor GraphQLNonNull cannot be invoked without 'new'. I have checked the open/closed issues in the git repo and seems no one is having similar problems with me.
my node version is v14.15.1 my npm libraries versions:
"@apollo/gateway": "^0.44.0",
"apollo-server": "^3.5.0",
"graphql": "^16.0.1"
Appreciate it if I can get any leads from anyone, cheers.