A Pokemon GraphQL API
- Pokemon
- Abilities (Pagination)
- Ability Info
- Gender
- Pokedex (Primary Info)
- Berries
- Contests
- Encounters
MIT ยฉ Pokegraph-API
A Pokemon GraphQL API
Home Page: https://pokegraph-api.herokuapp.com
License: MIT License
A Pokemon GraphQL API
MIT ยฉ Pokegraph-API
๐ Problem
Currently on typescript project change, we have to stop the CLI and re-run it.
โ
Definition of Done
Use nodemon for watch on dev script and don't have to stop the CLI
This should be a global setup
Migration to Graphql, only primary fields
Migration of Rest API to Graphql, only the primary fields
Let's take into consideration the following article for this one,
https://css-tricks.com/stay-dry-using-axios-for-api-requests/
Moreover, all requests should be placed in a service file, for debugging and an easy way to locate these calls.
Migration characteristic primary info to GraphQL
RestAPI response
{
"id": 1,
"gene_modulo": 0,
"possible_values": [
0,
5,
10,
15,
20,
25,
30
],
"highest_stat": {
"name": "hp",
"url": "https://pokeapi.co/api/v2/stat/1/"
},
"descriptions": [
{
"description": "Loves to eat",
"language": {
"name": "en",
"url": "https://pokeapi.co/api/v2/language/9/"
}
}
]
}
GraphQL Response
{
"id": 1,
"gene_modulo": 0,
"possible_values": [
0,
5,
10,
15,
20,
25,
30
],
"highest_stat": {
"name": "hp",
"id": 1
},
"descriptions": [
{
"description": "Loves to eat",
"language": {
"name": "en",
"id": 9
}
}
]
}
Remove all pagination that currently has, and add it on developing the issue #17
Definition of done
get
to single entityI'm thinking about creating the pagination as a search
endpoint of Github GraphQL, so we will get like this.
{
pokedex(first:10, after:10) {
... on Pokemon {
nodes {
id
name
}
}
... on Ability {
nodes {
id
name
}
}
}
}
So we won't create an endpoint for each item paginations
Migration of Egg Groups to GraphQL
RestAPI
{
"id": 1,
"name": "monster",
"names": [
{
"name": "ใใใใ
ใ",
"language": {
"name": "ja",
"url": "https://pokeapi.co/api/v2/language/1/"
}
}
],
"pokemon_species": [
{
"name": "bulbasaur",
"url": "https://pokeapi.co/api/v2/pokemon-species/1/"
}
]
}
GraphQL
{
"id": 1,
"name": "monster",
"names": [
{
"name": "ใใใใ
ใ",
"language": {
"name": "ja",
"id": 1
}
}
],
"pokemon_species": [
{
"name": "bulbasaur",
"id": 1
}
]
}
Using pagination helps us get data faster, but if we have too much pagination it will take too long times making the request.
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.