Skip to content

Getting Started

Mac McCarthy edited this page Mar 17, 2020 · 1 revision

Authenticating

  1. Sign up for API Key from Goodreads. Once you have it, I find that the easiest way to implement it is either using an .env (I used dotenv) file or maybe even a config.json file.

  2. Once you have this key, it will be called as part of every URL, like so:

let xmlResp = await this.get(this.baseURL + `author/show/${inputObject.authorId}?format=xml&key=${process.env.API_KEY}`)

Connecting to the API on localhost

  1. Run node server.js
  2. Navigate to http://localhost:4000/ on your browser and you will see GraphqQL Playground.
  3. Try running the following query mutation:
{
  author(name: "Stephen King") {
    id
    name
    link
  }
}
Clone this wiki locally