Skip to content
Google Sheets Rest API transformed into GraphQL to be added as a remote schema in Hasura
JavaScript
Branch: master
Clone or download
Latest commit 08c5a2c Jul 30, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore add google sheets api Jul 30, 2019
README.md add google sheets api Jul 30, 2019
index.js add google sheets api Jul 30, 2019
package-lock.json add google sheets api Jul 30, 2019
package.json add google sheets api Jul 30, 2019
resolvers.js add google sheets api Jul 30, 2019
type_defs.js add google sheets api Jul 30, 2019

README.md

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

    glitch-deploy-button

  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
You can’t perform that action at this time.