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

Unable to perform expanded filtered query.

Open eyeruleall opened this issue 5 years ago • 2 comments

The two 'where' statements below are straight from the filters section of the igdb documentation. One works, the commented out one doesn't. None of the example queries showing how to query an expanded field work.

const igdb = igDB(igdbAPIKey)
async function main () {
  try {
    // const where = 'release_dates.platform = (6)'
    const where = '(platforms = [6,48] & genres = 13) | (platforms = [130,48] & genres = 12)'
    const response = await igdb
      .fields('name')
      .limit(2)
      .offset(0)
      .sort('name')
      .where(where)
      .request('/games')
    console.log(response.data)
  } catch (error) {
    console.log(error)
  }
}
main()

I can't query any expanded data on the "release_dates" section of the /games endpoint. The same query works from the shell using curl. This could just be outdated documentation, but since the issue only occurs here, I'm reporting it as a bug.

eyeruleall avatar Jan 25 '20 21:01 eyeruleall

Removing the .sort() option appears to do something to fix the issue, but it is still a bug.

eyeruleall avatar Jan 27 '20 14:01 eyeruleall

I'm currently having the same issue. Using .sort() the api return 406

alzedd avatar Dec 04 '21 19:12 alzedd