Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/christopherrobin/graphql-starter-pack
This is a starter pack for anyone looking to get a React/GraphQL/MongoDB proof of concept running quickly.
https://github.com/christopherrobin/graphql-starter-pack
apollo apollo-boost bootstrap cors graphql mongodb mongoose react react-router-dom
Last synced: 18 days ago
JSON representation
This is a starter pack for anyone looking to get a React/GraphQL/MongoDB proof of concept running quickly.
- Host: GitHub
- URL: https://github.com/christopherrobin/graphql-starter-pack
- Owner: christopherrobin
- License: bsd-3-clause
- Created: 2018-09-05T22:55:09.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-01-04T21:39:54.000Z (almost 2 years ago)
- Last Synced: 2023-03-07T21:57:33.902Z (almost 2 years ago)
- Topics: apollo, apollo-boost, bootstrap, cors, graphql, mongodb, mongoose, react, react-router-dom
- Language: JavaScript
- Homepage:
- Size: 1.73 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 14
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# GraphQL Starter Pack
This is a GraphQL Starter Pack for anyone looking to get a React/GraphQL/MongoDB proof of concept running quickly. In this example we will use books and authors.Roadmap includes:
- Static type checking
- OAuth
- Redux
- Heroku and/or AWS integration with documentationBased on iamshaunjp's `graphql-playlist` @ https://github.com/iamshaunjp/graphql-playlist
### Features
* React client side view for adding and viewing books
* Plug and play server set up for use with Mongo via mLab
* GraphQL query tool and queries to get started
* `http://localhost:4000/graphql` GraphQL Query Tool
* `http://localhost:3000/` Client Side Entry point### Toolbox
React, Express, GraphQL, MongoDB, Mongoose, Apollo, Lodash, Bootstrap, React-Router, dotenv, and CORS# Quick Start
1. `git clone https://github.com/christopherrobin/GraphQL-Starter-Pack.git`
2. `cd GraphQL-Starter-Pack && cd client && npm install`
3. Prepare your database
- Create a sandbox Mongo DB instance in mLab
- Insert database url/credentials into a `.env` in the root of the `server` folder
ex: `DATABASEURL=mongodb://:@ds233061.mlab.com:33061/`
- Create an author: Customize the _Add Author_ mutation from the _Helpful Queries_ section and insert data into our database using the GraphQL Query Tool
- Continue to populate database with dummy data as you see fit
5. `nodemon app` from root of server folder
6. `npm start` from root of client folder# Helpful Queries
### Add Author
```
mutation {
addAuthor(name:"Author Name", age: 50){
name
age
}
}
```### Add Book
```
mutation {
addBook(
name: "Book Title",
genre: "Genre",
authorId: ""){
name
genre
}
}
```### GET author by authorId
```
{
author(id:2){
name
age
books{
name
genre
}
}
}
```