igdb-api-node icon indicating copy to clipboard operation
igdb-api-node copied to clipboard

How to write Multi-Query

Open shubhambattoo opened this issue 2 years ago • 2 comments

How to achieve writing Multi-Query?

shubhambattoo avatar Oct 23 '23 20:10 shubhambattoo

How to achieve writing Multi-Query?

did you discovered how to write it?

GerardPolloRebozado avatar Aug 29 '24 09:08 GerardPolloRebozado

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.

GerardPolloRebozado avatar Aug 29 '24 13:08 GerardPolloRebozado