mirror of
https://github.com/PokeAPI/pokeapi
synced 2024-11-29 14:50:24 +00:00
35 lines
727 B
GraphQL
35 lines
727 B
GraphQL
"""
|
|
Returns the strongest 3 grass and poison pokemon. It uses thier stats to compute their strenght.
|
|
"""
|
|
|
|
query best_grass_poison_pokemons {
|
|
pokemon: pokemon_v2_pokemon(
|
|
where: {
|
|
_and: [
|
|
{
|
|
pokemon_v2_pokemontypes: {
|
|
pokemon_v2_type: { name: { _eq: "grass" } }
|
|
}
|
|
}
|
|
{
|
|
pokemon_v2_pokemontypes: {
|
|
pokemon_v2_type: { name: { _eq: "poison" } }
|
|
}
|
|
}
|
|
]
|
|
}
|
|
order_by: {
|
|
pokemon_v2_pokemonstats_aggregate: { sum: { base_stat: desc } }
|
|
}
|
|
limit: 3
|
|
) {
|
|
name
|
|
stats: pokemon_v2_pokemonstats_aggregate(order_by: {}) {
|
|
aggregate {
|
|
sum {
|
|
base_stat
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|