Meteor import error: createApolloServer is not a function

Viewed 1407

So I'm attempting to get an Apollo server working with an existing Meteor project. In my project directory, I ran

meteor add apollo
meteor npm install --save apollo-client graphql-server-express express graphql 
graphql-tools body-parser

to add Apollo to my project and install all the dependencies I'll need later. When I attempt to create my Apollo server in my imports/startup/index.js file, I get the error

TypeError: createApolloServer is not a function

I know this means that the function is not importing correctly, but I'm not sure why the package wouldn't be available in my code since I added it. Am I missing something obvious?

import/startup/index.js

import { createApolloServer } from 'meteor/apollo';
import { makeExecutableSchema } from 'graphql-tools';

createApolloServer({});
2 Answers

In .meteor/packages, make sure you are using Apollo@2.0.0

Related