0.1.1 • Published 5 years ago

gatsby-source-itchio v0.1.1

Weekly downloads
2
License
MIT
Repository
github
Last release
5 years ago

gatsby-source-itchio

A source plugin for GatsbyJS to query game information from the itch.io serverside API.

Install

# npm
npm install --save gatsby-source-itchio

#yarn
yarn add gatsby-source-itchio

Then add the following to your gatsby-config.js:

module.exports = {
  /* ... */
  plugins: [
    /* ... */
    {
      resolve: "gatsby-source-itchio",
      options: {
        key: // YOUR_API_KEY
      }
    }
  ]
};

To use this plugin, you'll need a web API key for your itch.io account (get one here).

How to query

See API documentation for the endpoint here.

const gameQuery = `
  query GameQuery {
    allItchioGame(limit: 10) {
      edges {
        node {
          user {
            display_name,
            id,
            url,
            cover_url,
            username
          },
          id,
          url,
          created_at,
          title,
          classification,
          type,
          short_text,
          published,
          published_at,
          views_count,
          can_be_bought,
          min_price,
          purchases_count,
          p_osx,
          p_android,
          p_linux,
          p_windows,
          in_press_system,
        }
      }
    }
  }
`;