Skip to content

Firebase info

Mats Tyldum edited this page Mar 9, 2021 · 3 revisions

Firebase-tools

  • To test, develop and manage Firebase functions you need to install firebase-tools on your device:
npm install -g firebase-tools

To login using Google run the following command in your terminal:

firebase login

Set local runtime variables

Variables can be found at in the Heroku dashboard

firebase functions:config:set hasura.graphql_api="YOUR_GraphQL_API" hasura.graphql_admin_secret="ADMIN_SECRET"

Or

firebase functions:config:get > .runtimeconfig.json

Generate GraphQL types

Download the schema file

gq https://hover-server.herokuapp.com/v1/graphql --header "X-Hasura-Admin-Secret: ADMIN_SECRET" --introspect > schema.graphql

Then generate using

npm run generate

Testing and Deployment

Check that your code runs

npm run serve

The command wil serve all functions locally, and each can be tested using tool such as Postman. When the functions are ready for deployment, run:

npm run deploy