|
| 1 | +# 🔥 fireQL |
| 2 | + |
| 3 | +> 🔥 Simple graphQL implementation on top of firebase cloud functions ☁️ |
| 4 | +
|
| 5 | +## What!? Firebase & GraphQL? Why? |
| 6 | + |
1 | 7 | **TL;DR**: GraphQL shines where Firebase falls short. Powerful data modeling, flexible and efficient queries and the open specification are all essential parts of GraphQL that are lacking with Firebase. |
2 | 8 |
|
3 | | -## Powerful Data Modeling |
| 9 | +### Powerful Data Modeling |
4 | 10 |
|
5 | 11 | Firebase has received a lot of criticism based on its limited data modeling. Basically, your data is structured as a single, huge JSON that states the same data multiple times. What seems convenient at first results in unmanageable client code whenever you need to update data, as you have to keep track of all the references to the same data manually. |
6 | 12 |
|
7 | 13 | The data structure used in GraphQL on the other hand is very intuitive and familiar to think about, as it is modelled as a graph. Using the IDL syntax we can easily describe our data model, called the GraphQL schema. |
8 | 14 |
|
9 | | -## Flexible and Efficient Queries |
| 15 | +### Flexible and Efficient Queries |
10 | 16 |
|
11 | 17 | The flexible query capabilities of GraphQL is one its main benefits. Queries are hierarchical, that means you can specify data requirements that mirror the graph structure. |
12 | 18 |
|
13 | 19 | All of that is simply not possible with Firebase. |
14 | 20 |
|
15 | 21 | Extended explanation in **[stackoverflow](http://stackoverflow.com/a/42927556)** |
| 22 | + |
| 23 | +## Deploying your graphQL function |
| 24 | +``` |
| 25 | +firebase deploy --only functions |
| 26 | +``` |
| 27 | + |
| 28 | + |
| 29 | + |
| 30 | + |
| 31 | +## Testing your graphQL queries |
| 32 | + |
| 33 | + |
| 34 | + |
| 35 | +I recomend [graphiQL](https://github.com/graphql/graphiql) |
| 36 | +> An in-browser IDE for exploring GraphQL. |
| 37 | +
|
| 38 | +You can get the desktop version [here](https://github.com/skevy/graphiql-app) or install via Homebrew: |
| 39 | + |
| 40 | +``` |
| 41 | +brew cask install graphiql |
| 42 | +``` |
| 43 | + |
| 44 | +Paste your function URL (you will see it after deploying your function) and star testing your grapQL queries |
0 commit comments