The Apollo Server backend shared by all Apollo client example apps.
Demonstrates:
- GraphQL schema, resolvers, models, and connectors to read from two different data sources, GitHub REST API and SQL
- Web server with authentication and basic authorization using Express, Passport, and Apollo Server
Please submit a pull request if you see anything that can be improved!
Make sure you have Node.js 4 or newer installed.
git clone https://github.com/apollostack/GitHunt.git
cd GitHunt
npm install
Set up the SQLite database and run migrations/seed data with the following commands:
npm run migrate
npm run seed
- Go to OAuth applications > Developer applications in GitHub settings
- Click 'Register a new application' button
- Register your application like below
- Click 'Register application' button
On the following page, grab:
- Client ID
- Client Secret
Set your Client ID and Client Secret Environment variables:
export GITHUB_CLIENT_ID="your Client ID"
export GITHUB_CLIENT_SECRET="your Client Secret"
Or you can use dotenv
.
cp .env.default .env
and edit with your Github keys.
npm start
- Open graphiql at http://localhost:3010/graphiql