Migrate to Netlify Today

Netlify announces the next evolution of Gatsby Cloud. Learn more

ContactSign Up
Community Plugin
View plugin on GitHub

gatsby-source-pokeapi

A gatsby source plugin to fetch Pokemon data through the famous https://pokeapi.co/ API.

Installation

npm install gatsby-source-pokeapi

How to use

In your gatsby-config.js

module.exports = {
  plugins: [
    {
      resolve: `gatsby-source-pokeapi`,
      options: {
        nbOfPokemons: 251,
      },
    },
  ],
}

How to query

query {
  allPokemon {
    nodes {
      name
      stats {
        attack
        defense
        special_attack
        hp
        special_defense
        speed
      }
      types
    }
  }
}

License

This project is under the MIT license.

© 2023 Gatsby, Inc.