Google Sheets API is a service to read, write and format data in sheets programatically.
Adding Google Sheets as Remote Schema
To be able to query Google Sheets data via Hasura, it needs to be added as a Remote Schema using the Hasura Console.
- Get the Google Sheets API Key by visting the Authorize Requests Sheets API page.
- Set the API key as
- We need to input the spreadsheet id from where we are going to fetch data. Set that as
SPREADSHEET_IDenvironment variable. We can find the sheet ID in the url.
- This custom resolver is used to accept a user's email and will return a filtered list of data pertaining to that user.
Google Sheets API Documentation
Deploy with Glitch
Click the following button to edit on glitch
Add the following environment variables in the
.envfile on glitch.
GOOGLE_SHEETS_API_KEY=xxx SPREADSHEET_ID=xxx PORT=3000
npm install PORT=3000 GOOGLE_SHEETS_API_KEY=xxx SPREADSHEET_ID=xxx npm start