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

Unable to perform expanded filtered query. #37

Open eyeruleall opened 4 years ago

eyeruleall commented 4 years ago

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 commented 4 years ago

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

alzedd commented 2 years ago

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