An implementation of pokeapi.co with GraphQL using TypeGraphQL.
Schemas are created based on Pokeapi V2 API Reference but it doesn't seem to be the latest. Some(but don't remember which ones) are updated according to actual api responses by the time of coding in early May, 2019.
Try it out >>> >> > pokeapi-typegraphql on heroku < << <<<
CAUTION: Some schema returns array with hundreds of elements, which causes the same amount of requests towards pokeapi.co.
PokéAPI is free and open to use. It is also very popular. Because of this, we ask every developer to abide by our fair use policy. People not complying with the fair use policy will have their IP address permenantly banned.
PokéAPI is primarily an educational tool, and we will not tolerate denial of service attacks preventing people from learning.
Rules:
Locally cache resources and images whenever you request them.
Use the correct user-agent header in API requests.
Be nice and friendly to your fellow PokéAPI developers.
-
InputUnion type to merge byId and byName as one (upstream feature not ready yet)
-
load all data in database(SQL/NoSQL?) to elimicate requests to pokeapi.co
yarn install && yarn dev
By default, server will listen on port 4000: http://localhost:4000/graphql
{
pokemonByID(id: 1) {
name
weight
abilities {
ability {
name
isMainSeries
generation {
name
mainRegion {
name
}
}
}
}
sprites {
frontDefault
frontShiny
frontFemale
frontShinyFemale
}
}
}
-
Ability
-
Berry
-
BerryFirmness
-
BerryFlavor
-
Characteristic
-
ContestEffect
-
ContestType
-
EggGroup
-
EncounterCondition
-
EncounterConditionValue
-
EncounterMethod
-
EvolutionChain
-
EvolutionTrigger
-
Gender
-
Generation
-
GrowthRate
-
Item
-
ItemAttribute
-
ItemCategory
-
ItemPocket
-
Language
-
Location
-
LocationArea
-
Machine
-
Move
-
MoveAilment
-
MoveBattleStyle
-
MoveCategory
-
MoveDamageClass
-
MoveLearnMethod
-
MoveTarget
-
Nature
-
PalParkArea
-
PokeathlonStat
-
Pokedex
-
Pokemon
-
PokemonColor
-
PokemonHabitat
-
PokemonForm
-
PokemonShape
-
PokemonSpecies
-
Region
-
Stat
-
SuperContestEffect
-
Type
-
Version
-
VersionGroup