igdb-api-node
igdb-api-node copied to clipboard
Unable to perform expanded filtered query.
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.
Removing the .sort() option appears to do something to fix the issue, but it is still a bug.
I'm currently having the same issue. Using .sort()
the api return 406