A source plugin for GatsbyJS to query game information from the itch.io serverside API.
# 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).
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,
}
}
}
}
`;