mirror of
https://github.com/hasura/graphql-engine.git
synced 2024-12-15 01:12:56 +03:00
firebase2graphql: add realtime section in readme (#674)
This commit is contained in:
parent
de2ceea132
commit
68c5f8ca85
@ -14,6 +14,7 @@ A CLI tool to help you try realtime GraphQL on your firebase data. It takes data
|
||||
- [Installation](#installation)
|
||||
- [Usage](#usage)
|
||||
- [Command](#command)
|
||||
- [Realtime](#realtime)
|
||||
- [Usage comparison](#usage-comparison---firebase-sdk-vs-graphql)
|
||||
- [Authentication](#authentication)
|
||||
- [Next steps](#next-steps)
|
||||
@ -232,6 +233,34 @@ firebase2graphql URL [flags]
|
||||
- `-v --version`: show CLI version
|
||||
- `-h, --help`: show CLI help
|
||||
|
||||
## Realtime
|
||||
|
||||
With Hasura, you can query the data in Postgres realtime in the form of GraphQL subscriptions. In this way, using this tool, you get exactly the same Firebase API over GraphQL while retaining the live queries feature.
|
||||
|
||||
Consider this query:
|
||||
|
||||
```graphql
|
||||
query {
|
||||
user {
|
||||
id
|
||||
name
|
||||
email
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
You can convert it into a subscription by simply replacing `query` with `subscription`.
|
||||
|
||||
```
|
||||
subscription {
|
||||
user {
|
||||
id
|
||||
name
|
||||
email
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Usage comparison - Firebase SDK vs GraphQL
|
||||
|
||||
A typical query to do a single read from the database using [Firebase SDK](https://firebase.google.com/docs/reference/), (javascript) would look something like:
|
||||
|
Loading…
Reference in New Issue
Block a user