GraphQL Pokedex Datasource
query GetPokemonById {
pokemonById(id: "148") {
id
name
category
types
abilities {
name
effect
isHidden
}
evolution {
from {
id
name
}
to {
id
name
}
}
weaknesses
resistances
immunities
baseStats {
hp
attack
defense
specialAttack
specialDefense
speed
total
}
}
} |
{
"data": {
"pokemonById": {
"id": "148",
"name": "Dragonair",
"category": "Dragon",
"types": ["Dragon"],
"abilities": [
{
"name": "Shed Skin",
"effect": "Heals the body by shedding.",
"isHidden": false
},
{
"name": "Marvel Scale",
"effect": "Ups DEFENSE if suffering.",
"isHidden": true
}
],
"evolution": {
"from": {
"id": "147",
"name": "Dratini"
},
"to": [
{
"id": "149",
"name": "Dragonite"
}
]
},
"weaknesses": [
"Dragon",
"Fairy",
"Ice"
],
"resistances": [
"Electric",
"Fire",
"Grass",
"Water"
],
"immunities": [],
"baseStats": {
"hp": 61,
"attack": 84,
"defense": 65,
"specialAttack": 70,
"specialDefense": 70,
"speed": 70,
"total": 420
}
}
}
} |
- node >= 16
- npm >= 7.20.x
- Docker (optional, but recommended for local development)
# Install Dependencies
$ npm i
# Start Apollo Server
$ npm run devDocker Compose is also available for local development:
$ docker compose upNote: Using Docker Compose is optional, but highly recommended if you don't want to run other services locally, like the pokemon-type-chart service.
# Run All Unit Tests
$ npm test
# Run Specific Unit Test
$ npm run test:only <path of test>$ npm run generate# Lint Source Code
$ npm run lint
# Make the linter fix the Source Code
$ npm run lint:fix