@halkeye/gatsby-source-goodreads

0.1.0 • Public • Published

gatsby-source-goodreads

Source plugin for pulling your read books into Gatsby from Goodreads API.

How to use

// In your gatsby-config.js
module.exports = {
  plugins: [
    {
      resolve: "gatsby-source-goodreads",
      options: {
        developerKey: "IAmDeveloperKey",
        goodReadsUserId: "IAmGoodreadsUserId",
        userShelf: "to-read" //optional
      }
    }
  ],
}

Plugin options

  • developerKey: Use your Goodreads developer API key
  • goodReadsUserId: The Goodreads user ID of the user to get data for.
  • userShelf: OPTIONAL. read, currently-reading, to-read, etc.

How to query your Goodread data using GraphQL

Below is a sample query for fetching the shelf's books.

query goodRead {
  allGoodreadsShelf(filter: {shelfNames: {in: ["currently-reading"]}}) {
    edges {
      node {
        shelfNames
        review {
          reviewID
          rating
          votes
          spoilerFlag
          dateAdded
          dateUpdated
        }
        book {
          bookID
          isbn
          isbn13
          textReviewsCount
          uri
          link
          title
          titleWithoutSeries
          imageUrl
          smallImageUrl
          largeImageUrl
          description
        }
      }
    }
  }
}

Package Sidebar

Install

npm i @halkeye/gatsby-source-goodreads

Weekly Downloads

0

Version

0.1.0

License

MIT

Unpacked Size

7.49 kB

Total Files

5

Last publish

Collaborators

  • halkeye