Skip to content

Latest commit

 

History

History
 
 

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

README.md

Chapter 5 - Creating a GraphQL API

We've explored the history. We've written some queries. We've created a schema. Now you're ready to create a fully functioning GraphQL service. In this chapter, we'll use Apollo Server 2.0, an open source solution from Meteor Development Group, to stand up a GraphQL server for the PhotoShare project. Along the way, we'll solidify a schema, write resolvers, incorporate a database, and add GitHub authorization to the project.

In this chapter, we'll build the PhotoShare API. The completed files for this chapter can be found at photo-share-api.

PhotoShare API

To run these files, simply:

  1. Go to the photo-share-api folder.
  2. Run npm install on the folder.
  3. Replace the values of the .env file with your unique variables.
DB_HOST=<YOUR_MONGODB_HOST>
CLIENT_ID=<YOUR_GITHUB_CLIENT_ID>
CLIENT_SECRET=<YOUR_GITHUB_CLIENT_SECRET>
  1. Run npm start and open your browser to http://localhost:4000/playground.

Want to see the project running on Glitch instead?

Remix on Glitch

Note: You'll still need to replace the values of the .env file with your unique variables, as shown in step 3.

Resource Links

Database Integration

GitHub Authorization