A GraphQL wrapper for the League of Legends API.
- Install dependencies (
npm install | yarn install | pnpm install
) - Start the application with
npm start
- Make a request to
/graphql
passing your Riot API key in the "X-Riot-Token" header
-
Summoner
- Past matches
- Current game
- Champion mastery
- Ranked information
-
Match
- Players divided by teams
- Getting all summoners info
So if you can turn 22 queries into one! For example, getting your current game players level and their rank:
-
Before
/lol/summoner/v4/summoners/by-name/{summonerName}
to get your summonerId/lol/spectator/v4/active-games/by-summoner/{summonerId}
for current match- 10x
/lol/summoner/v4/summoners/{summonerId}
to get the level of the match players technically 9 because you already queried your own summoner) - 10x
/lol/league/v4/positions/by-summoner/{summonerId}
to get their current rank position
-
After
{
summoner(name: "Luca") {
id
currentGame {
teams {
participants {
summoner {
name
summonerLevel
leagues {
solo {
tier
rank
}
flex {
tier
rank
}
}
}
}
}
}
}
}
- All ranked endpoints
- Region-agnostic
- Better caching (redis?)
- Receiving api key from request headers instead of storing on server