What is Firebase2GraphQL?
Firebase2GraphQL is a command-line interface (CLI) tool that enables developers to transition from Firebase Realtime Database to a GraphQL API backed by Postgres. The tool works by taking data exported from Firebase as JSON and importing it into Postgres through Hasura GraphQL Engine, which automatically provides realtime GraphQL capabilities. This allows developers to leverage the power of GraphQL while retaining the data structure from Firebase.
The process involves three simple steps: deploying Hasura GraphQL Engine on Heroku, exporting JSON data from the Firebase Console, and using the Firebase2GraphQL CLI to import the data into Postgres. Once the data is imported, users can immediately start querying it with GraphQL, benefiting from realtime subscriptions and a robust relational database backend.
Features
- Instant GraphQL APIs: Automatically generates GraphQL schema from imported data.
- Realtime Subscriptions: Supports realtime GraphQL subscriptions out-of-the-box.
- CLI Tool: Simple command-line interface for data migration.
- Postgres Backend: Leverages the reliability and power of Postgres database.
- Heroku Deployment: Easy one-click deployment of Hasura GraphQL Engine on Heroku.
Use Cases
- Migrating from Firebase Realtime Database to a GraphQL-based architecture.
- Building realtime applications with GraphQL subscriptions.
- Combining Firebase data with Postgres for advanced querying capabilities.
- Rapidly prototyping GraphQL APIs using existing Firebase data.
FAQs
-
What is Firebase2GraphQL?
Firebase2GraphQL is a CLI tool that exports data from Firebase Realtime Database and imports it into Postgres via Hasura GraphQL Engine, providing instant realtime GraphQL APIs. -
How do I get started with Firebase2GraphQL?
First, deploy Hasura GraphQL Engine to Heroku. Then, export your Firebase data as JSON from the Firebase Console. Finally, use the Firebase2GraphQL CLI to import the data into Postgres. You can then start querying with GraphQL. -
Do I need to manually create GraphQL schema?
No, the Hasura GraphQL Engine automatically generates the GraphQL schema based on the imported data, so you do not need to write any schema manually. -
Is Firebase2GraphQL free to use?
Yes, Firebase2GraphQL is a free and open-source CLI tool.