Welcome to the server portion of the workshop! For the morning session, we will be building a GraphQL server based on the Movie DB REST API.
server.js: Where all the magic happens to set up Apollo Serverschema.js: Your GraphQL schema goes hereresolvers/: Write your resolvers for each type in this folderdata-sources/: Your data sources separate out the data fetching logic from your resolvers
-
Click this button to remix the project
-
On the left hand menu in Glitch, click Status > Console
-
Confirm you're tracking origin by running
git remote -v. If you are, then you can skip step #4 and go to step #5 -
If you are not tracking origin, run this command:
git remote add origin https://github.com/apollographql/fullstack-workshop-server && git fetch origin && git checkout 00-start && refresh-
If you are tracking origin, run this command:
git fetch origin && git checkout 00-start && refresh -
Navigate to
server.js. You should not see anyApolloServersetup code. If that's the case, then you're good to go!
00-start: Your starting point01-apollo-server: Setting up Apollo Server02-schema: Writing your schema03-data-sources: Building data sources04-authentication: Implementing authentication05-final: Hooking everything up to resolvers
- I didn't complete the last exercise and want to catch up: No worries! I've created branches for all the steps in the workshop so everyone can go at their own pace. To check out the completed solution for your exercise, look for the branch above. In your Glitch terminal or local terminal, replace
01-apollo-serverwith the exercise you're on:
git stash
git checkout 01-apollo-server- Clone the repo:
git clone https://github.com/apollographql/fullstack-workshop-server - Then, make a
.envfile with anENGINE_API_KEYenvironment variable. You can get one here by creating your own Engine service. - Install the dependencies:
npm i - Start the server:
npm start. Your server will be running on port 3000. Your GraphQL server is available atlocalhost:3000/graphqland your GraphQL Playground is available atlocalhost:3000/graphql.