Monotype or dual types #960
Answered
by
Naramsim
lostcat420
asked this question in
Q&A
-
If wanted to query for Pokemon that are monotypes or a combination of two types, what is the best way to do this? I was thinking of the idea to find dual types by querying both types individually, then checking for duplicates. However, if I wanted to find monotypes, it's not possible to exclude Pokemon that are dual types. I'm fairly unsophisticated when it comes to this type of stuff, so apologies in advance 😅 |
Beta Was this translation helpful? Give feedback.
Answered by
Naramsim
Nov 20, 2023
Replies: 1 comment 1 reply
-
Hi, the best is to use GraphQL: query samplePokeAPIquery {
pokemon_v2_pokemon(where: {pokemon_v2_pokemontypes_aggregate: {count: {predicate: {_gte: 2}}}}) {
id
pokemon_v2_pokemontypes {
pokemon_v2_type {
name
}
}
name
}
} https://pokeapi.co/docs/graphql The query extracts all the pokemon with 2 or more types. |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
lostcat420
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi, the best is to use GraphQL:
https://pokeapi.co/docs/graphql
The query extracts all the pokemon with 2 or more types.