favware / graphql-pokemon Goto Github PK
View Code? Open in Web Editor NEWExtensive Pokémon GraphQL API
Home Page: http://graphql-pokemon.js.org/
License: MIT License
Extensive Pokémon GraphQL API
Home Page: http://graphql-pokemon.js.org/
License: MIT License
The code should really be unit tested tbh
Please describe the problem you are having in as much detail as possible:
Sprites are missing the .gif extension thus resulting in invalid URLs
Include a reproducible code sample here, if possible:
fragment dexdetails on DexDetails {
num species types
abilities { first second hidden special }
baseStats { hp attack defense specialattack specialdefense speed }
gender { male female special }
color eggGroups evolutionLevel evos prevo forme formeLetter
height weight baseForme baseSpecies otherFormes
sprite shinySprite smogonTier
bulbapediaPage serebiiPage smogonPage
flavorTexts { game flavor }
}
fragment evolutions on DexDetails {
evolutions { ...dexdetails }
preevolutions { ...dexdetails }
}
{
getPokemonDetails(pokemon:melmetal) {
...dexdetails
...evolutions
}
}
Further details:
Is your feature request related to a problem? Please describe.
This is less a feature request than a proposition. I have implemented a documentation generator for GraphQL called Magidoc, and I am trying to bring this into open source projects in order to get some feedback and get the user-base to grow. I came across your project in my research.
Describe the solution you'd like
Basically, I noticed you didn't have Github pages set up yet, so I propose to implement an auto-generated GraphQL documentation for this project that would be hosted directly into the Github Pages. This could contain an auto-generated API Reference and whatever else you like in fact.
I don't mind doing the whole thing and opening a PR, or letting you try it out and give me feedback about what you liked and disliked.
In the end, it's just a proposition, so no pressure at all if you're not interested. Thank you!
Is your feature request related to a problem? Please describe.
With v1.0.0 all fields are always returned because they are returned as a GraphQLJSONObject. By writing custom Scalar Object Types subfield selections can be made.
Describe the ideal solution
Custom Scalar types should be written
Additional context
The SpaceX API also has this kind of system
Currently the response of getAllPokemon
is, by default, not paginated. This sets a hard limit on how much data can be returned defined by the string limit that the v8 engine can handle (~1GB). At the time of writing (2023-15-12) with the data from Scarlet & Violet Indigo Disk the full JSON is ~524 MB. This size will ever only increase as time goes on and more Pokémon are released. Furthermore, this limit also blocks the expansion of further nesting data, such as changing otherFormes
to be proper Pokemon
references as opposed to just species strings.
Important
This change would be a breaking change because the response of getAllPokemon
would drastically change.
To resolve this issue the response from getAllPokemon
should be paginated by default. The following rules will be applied:
interface PaginatedResponse {
data: TheOldDataObject;
totalCount: number; // The total count of results
pages: number; // The total amount of pages based on taken and totalCount
page: number; // The current page number
offsetForCurrentPage: number; // The offset provided for this request
offsetNextPage: number; // The offset to provide to jump to the next page
taken: number; // The amount taken (length of data)
}
#899 where otherFormes
nesting was added as an attempt to provide more data to the end-user
Toxitricity GMax has been released which can now be included
High resolution images of pokemon would be a neat addition
redirection links to serebii images
none
No response
This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.
These updates are awaiting their schedule. Click on a checkbox to get an update now.
@vitest/coverage-v8
, docker/build-push-action
, vitest
)These are blocked by an existing closed PR and will not be recreated unless you click a checkbox below.
docker-compose.yml
Dockerfile
node 20-alpine
.github/workflows/auto-updater.yml
actions/checkout v4
actions/setup-node v4
actions/upload-artifact v4
actions/upload-artifact v4
.github/workflows/branch-imager.yml
actions/checkout v4
docker/setup-buildx-action v3.4.0
docker/login-action v3.2.0
docker/login-action v3.2.0
docker/build-push-action v6.3.0
.github/workflows/continuous-deployment.yml
actions/checkout v4
docker/setup-buildx-action v3.4.0
docker/login-action v3.2.0
docker/login-action v3.2.0
docker/build-push-action v6.3.0
peter-evans/dockerhub-description v4
actions/checkout v4
actions/setup-python v5
favware/ssh-remote-action v1
actions/checkout v4
actions/setup-node v4
actions/upload-artifact v4
actions/checkout v4
actions/setup-node v4
actions/upload-artifact v4
actions/upload-artifact v4
actions/checkout v4
actions/download-artifact v4
actions/download-artifact v4
actions/download-artifact v4
actions/setup-node v4
actions/checkout v4
actions/setup-node v4
actions/download-artifact v4
actions/download-artifact v4
actions/download-artifact v4
.github/workflows/continuous-integration.yml
actions/checkout v4
actions/setup-node v4
actions/checkout v4
github/codeql-action v3
github/codeql-action v3
actions/checkout v4
actions/setup-node v4
actions/checkout v4
actions/setup-node v4
.github/workflows/labelsync.yml
actions/checkout v4
crazy-max/ghaction-github-labeler v5
.github/workflows/static-documentation.yml
actions/checkout v4
actions/configure-pages v5
actions/setup-node v4
actions/upload-pages-artifact v3
actions/deploy-pages v4
package.json
graphql ^16.9.0
@apollo/server ^4.10.4
@as-integrations/koa ^1.1.1
@commitlint/cli ^19.3.0
@commitlint/config-conventional ^19.2.2
@discordjs/collection ^2.1.0
@favware/cliff-jumper ^4.0.2
@graphql-codegen/cli ^5.0.2
@graphql-codegen/schema-ast ^4.1.0
@koa/cors ^5.0.0
@magidoc/cli ^6.0.0
@sapphire/eslint-config ^5.0.5
@sapphire/fetch ^3.0.2
@sapphire/prettier-config ^2.0.0
@sapphire/shapeshift ^4.0.0
@sapphire/timestamp ^1.0.3
@sapphire/ts-config ^5.0.1
@skyra/jaro-winkler ^1.1.1
@swc/core ^1.6.13
@types/async ^3.2.24
@types/cheerio ^0.22.35
@types/koa ^2.15.0
@types/koa-bodyparser ^4.3.12
@types/koa__cors ^5.0.0
@vitest/coverage-v8 ^2.0.2
async ^3.2.5
cheerio ^1.0.0-rc.12
colorette ^2.0.20
cz-conventional-changelog ^3.3.0
eslint ^8.57.0
eslint-config-prettier ^9.1.0
eslint-plugin-prettier ^5.1.3
graphql-tag ^2.12.6
json-stream-stringify ^3.1.4
koa ^2.15.3
koa-bodyparser ^4.4.1
lint-staged ^15.2.7
npm-run-all2 ^6.2.2
prettier ^3.3.3
replace-in-file ^8.1.0
rimraf ^6.0.1
tsup ^8.1.0
tsx ^4.16.2
vitest ^2.0.2
node 20.15.1
ansi-regex ^5.0.1
minimist ^1.2.8
yarn 4.3.1
scripts/manual-tests/requirements.txt
requests ==2.32.3
autopep8 ==2.3.1
pylint ==3.2.5
When adding specific properties in the query builder instead of showing the nested properties it just keeps adding itself to the path
It should display a list of nested properties
not sure if the issue lies with apollo and how many fields are affected, but this happens with quite a few of them
Currently the otherFormes
field for a Pokemon
is an array of strings, however, this field could be a nested reference to the actual Pokémon. This is currently blocked by #900 as v8 cannot handle so much data, but once that issue is resolved this should be changed.
otherFormes
should be a [Pokemon!]
type instead of a [String!]
typeN.A.
The bulk of the changes are already done in #899.
Item data should updated for Generation 8
showdown provides all cries as mp3 and ogg under
"https://play.pokemonshowdown.com/audio/cries/:species.mp3"
"https://play.pokemonshowdown.com/audio/cries/:species.ogg"
two additional fields on the Pokemon object, cryMP3URL
, cryOGGURL
manually formatting the url within source code, which works, but hey still would be useful
No response
Since the release of v1.1.0 more data has been discovered and this changed data should be included in the v1.2.0 release of the API.
Pokedex data should updated for Generation 8
Once all is done a cleanup throughout the code should be performed
One example is pichu spiky eared which only has a DPP sprite. Adding 2 option fields "specialSprite" and "specialSpriteShiny" will let us specify sprites for these Pokémon. The special fields are then preferred when parsing to DexDetails.
A field on the Pokemon object containing the classification (see serebii)
An additional field on the object holding the string
Could prolly look around myself if there's a decent way to scrape it again like 2 years ago
none
Would be useful for my CoreML AI PokéDex
Please describe the problem you are having in as much detail as possible:
It appears that the evos
and prevo
fields are not being parsed correctly because they are reported as null
even on something like Ivysaur.
Include a reproducible code sample here, if possible:
fragment dexdetails on DexDetails {
num species types
abilities { first second hidden special }
baseStats { hp attack defense specialattack specialdefense speed }
gender { male female special }
color eggGroups evolutionLevel evos prevo forme formeLetter
height weight baseForme baseSpecies otherFormes
sprite shinySprite smogonTier
bulbapediaPage serebiiPage smogonPage
flavorTexts { game flavor }
}
fragment evolutions on DexDetails {
evolutions { ...dexdetails }
preevolutions { ...dexdetails }
}
{
getPokemonDetails(pokemon:melmetal) {
...dexdetails
...evolutions
}
}
Further details:
Following issue #900 the same should be applied to the getFuzzy{Ability, Pokemon, Item, Learnset, Move}
queries so they forcibly use pagination as well.
For details refer to #900
N.A.
No response
Alias data should updated for Generation 8
Learnsets data should updated for Generation 8
Ability data should updated for Generation 8
This was requested by spacesanjeet#1363 on Discord. It would be nice if the base stats total would also be returned.
FlavorTexts data should updated for Generation 8
For Skyra it is required to also be able to fuzzy search on pokemon and learnset to make resolving arguments much much easier, therefore a query to support that has to be added.
The dragonite bot has some utilities for parsing the graphql-pokemon data. It would be useful if these are also exposed to users of graphql-pokemon.
@favware/graphql-pokemon/utilities
using export mapping in package.jsonN.A.
No response
Hello!
I hope you are doing well!
We are a security research team. Our tool automatically detected a vulnerability in this repository. We want to disclose it responsibly. GitHub has a feature called Private vulnerability reporting, which enables security research to privately disclose a vulnerability. Unfortunately, it is not enabled for this repository.
Can you enable it, so that we can report it?
Thanks in advance!
PS: you can read about how to enable private vulnerability reporting here: https://docs.github.com/en/code-security/security-advisories/repository-security-advisories/configuring-private-vulnerability-reporting-for-a-repository
GraphQL can generate client-side typings, these should be published to NPM as @favware/graphql-pokemon
Various gender ratios are incorrect, possibly due to wrong copy-pasting.
in pokemonResolver.ts, there is getAllPokemons, but when I access https://graphqlpokemon.favware.tech I can't find the query getAllPokemons
Can use query getAllPokemons from https://graphqlpokemon.favware.tech
I hope I can user query getAllPokemons from GrappQL endpoint, thanks
No response
Moves data should updated for Generation 8
Another niche field request birthed from working on PokéDex stuff, this page has phonetic listings for Gen 1-8, those would make for a niche but useful additional field
https://bulbapedia.bulbagarden.net/wiki/User:SnorlaxMonster/Pronunciation
An additional field on the Pokemon
object something along the lines of pronounciation
, ipa-notation
etc…
Scraping the page and bundling a json document into my application
I’ll do the above anyway and will attach the file later for ease of implementation if deemed useful enough
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.