Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kamilkisiela/angular2-graphql-rest
An Angular2 app with REST Api and GraphQL (apollo-client and angular2-apollo)
https://github.com/kamilkisiela/angular2-graphql-rest
Last synced: 3 days ago
JSON representation
An Angular2 app with REST Api and GraphQL (apollo-client and angular2-apollo)
- Host: GitHub
- URL: https://github.com/kamilkisiela/angular2-graphql-rest
- Owner: kamilkisiela
- Created: 2016-06-19T16:34:25.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2016-09-06T16:40:15.000Z (about 8 years ago)
- Last Synced: 2024-10-18T17:22:27.917Z (23 days ago)
- Language: JavaScript
- Homepage:
- Size: 66.4 KB
- Stars: 28
- Watchers: 6
- Forks: 5
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-graphql - angular2-graphql-rest - An example app with REST Api working side by side with GraphQL using Apollo Client with angular2-apollo. Includes step-by-step tutorial how to migrate from REST to GraphQL. (Examples / JavaScript Examples)
README
# Angular2 with REST Api and GraphQL
An example app with REST Api working **side by side** with GraphQL using [**Apollo Client**](https://github.com/apollostack/apollo-client) with [**angular2-apollo**](https://github.com/apollostack/angular2-apollo).
### Step by Step
I created a *step by step* process where you can see how to migrate from REST Api to using just GraphQL.
You can find it on the [`steps`](https://github.com/kamilkisiela/angular2-graphql-rest/tree/steps) branch.
**Starting point** - Working App with REST Api
**`1.X`** - Creating GraphQL endpoint
**`2.X`** - Building an app where REST Api works side by side with GraphQL
**`3.X`** - Migrating to use only GraphQL
### App
##### working with REST Api [*#rest*](https://github.com/kamilkisiela/angular2-graphql-rest/tree/rest)
```bash
git checkout rest
```##### working with GraphQL [*#graphql*](https://github.com/kamilkisiela/angular2-graphql-rest/tree/graphql)
```bash
git checkout graphql
```##### working with REST Api + GraphQL [*#both*](https://github.com/kamilkisiela/angular2-graphql-rest/tree/both)
```bash
git checkout both
```### How to start
We have to create needed sql tables
```bash
npm run migrate
```Then load some data
```bash
npm run seed
```Now, we're ready to start an app
```bash
npm start
```**OR just**
```bash
npm run start:clean
```to run all the commands above at once.