Closed EchedelleLR closed 2 years ago
Hi, this works by firing multiple requests.
If you only want to fire a single request and fetch different kinds of data, have a look at GraphQL. https://pokeapi.co/docs/graphql
Will this implemented through the promises library for fair use and make it easier?
I have no experience in GraphQL nor it is something done at the course level, only RESTful APIs.
We have plans to make GraphQL queries easier to write, but we lack time. There's no wrapper supporting GraphQL queries right now but it's as simple as making an HTTP call passing a JSON object. The server rate-limits 100 calls per hour per user/browser
Here a Node.js example: https://github.com/PokeAPI/pokeapi/tree/master/graphql/examples/node
Thank you for all of this.
In the middle of the process of making a Pokédex-like application, I saw that this library provides some kind of array encapsulation, allowing to make several requests with just one function call.
However, I want to know how the process is made in order to know if this would transform several requests to the API in just one concatenated.
The idea was to use this to implement a search component in the application since the other way consist in making one request to the general endpoint and a singler request per element of the results in the first request. As result, this could lead a decrement of the requests made to the API.