twitchtv / igdb-api-node

Nodejs Wrapper for IGDB.com API. Requires an API key. Get one at:
https://api.igdb.com/
MIT License
128 stars 15 forks source link

How to write Multi-Query #61

Open shubhambattoo opened 11 months ago

shubhambattoo commented 11 months ago

How to achieve writing Multi-Query?

GerardPolloRebozado commented 3 weeks ago

How to achieve writing Multi-Query?

did you discovered how to write it?

GerardPolloRebozado commented 3 weeks ago

How to achieve writing Multi-Query?

did you discovered how to write it?

just discovered how to do it. For example if you want to include genres in your game request you can do it like this: const gamesQuery = igdb().query('games', 'games-with-genre').fields(['name', 'genres.name']).where(id = ${id}); //here we create a query like every other query except that we dont add the .request const res = await igdb().multi([gamesQuery]).request('/multiquery'); //and here we use the query we have created passing it inside an array to multi() function.