google-sheets-remote-schema

Google Sheets Rest API transformed into GraphQL to be added as a remote schema in Hasura

Stars
12

google-sheets-remote-schema

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 GOOGLE_SHEETS_API_KEY environment variable.
  • We need to input the spreadsheet id from where we are going to fetch data. Set that as SPREADSHEET_ID environment 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

API Documentation.

Deploy with Glitch

  1. Click the following button to edit on glitch

  2. Add the following environment variables in the .env file on glitch.

    GOOGLE_SHEETS_API_KEY=xxx
    SPREADSHEET_ID=xxx
    PORT=3000
    

Running Locally

npm install
PORT=3000 GOOGLE_SHEETS_API_KEY=xxx SPREADSHEET_ID=xxx npm start
Badges
Extracted from project README
glitch-deploy-button