Skip to content
This repository has been archived by the owner on Jul 10, 2022. It is now read-only.

3-30-2019: "TypeError: apollo.graphqlExpress is not a function" #1

Open
vlhobbs opened this issue Mar 31, 2019 · 0 comments
Open

3-30-2019: "TypeError: apollo.graphqlExpress is not a function" #1

vlhobbs opened this issue Mar 31, 2019 · 0 comments

Comments

@vlhobbs
Copy link

vlhobbs commented Mar 31, 2019

Hello! I came across the article on learn.pusher.com recently. I wanted to let you know that the backend will not run properly when used with the current versions of Apollo Server. Attempting to run this with NPM 6.7 gave very little guidance, but when I used Yarn 1.15 to try again, I got the following error messages:

$ node ./bin/www
/home/user/WebDev/React/pusher-mud-backend/app.js:23
app.use('/graphql', apollo.graphqlExpress({ schema: graphqlSchema }));
                           ^

TypeError: apollo.graphqlExpress is not a function
    at Object.<anonymous> (/home/user/WebDev/React/pusher-mud-backend/app.js:23:28)
    at Module._compile (internal/modules/cjs/loader.js:805:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:816:10)
    at Module.load (internal/modules/cjs/loader.js:672:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:612:12)
    at Function.Module._load (internal/modules/cjs/loader.js:604:3)
    at Module.require (internal/modules/cjs/loader.js:711:19)
    at require (internal/modules/cjs/helpers.js:14:16)
    at Object.<anonymous> (/home/user/WebDev/React/pusher-mud-backend/bin/www:7:11)
    at Module._compile (internal/modules/cjs/loader.js:805:30)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

This seems to have something to do with the differences between Apollo Graphql versions 1.0 and 2.0 - I am using 2.4.8 at the moment. I am new to the software and have just started to research, but this site talks about the differences: Migration to 2.0.

Thanks for the great article!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant