Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is Expand still a thing in this latest API? #53

Open
adjstreams opened this issue Aug 1, 2022 · 1 comment
Open

Is Expand still a thing in this latest API? #53

adjstreams opened this issue Aug 1, 2022 · 1 comment

Comments

@adjstreams
Copy link

Looks like I can write requests directly to the API and expand will work, but this library doesn't support expand, is that right?

@4upz
Copy link

4upz commented Nov 23, 2022

@adjstreams I don't know if you were able to get an answer, but just in case -- it seems like you can still use expand with this wrapper the same way as it's described in the api docs by adding a sub-property to that field. So for genre, you could do genres.* or genres.name as part of the fields parameter. I was able to expand release_dates and directly grab the associated years when searching for a game with the following example:

const { data } = await igdb(clientId, token)
    .search('Halo')
    .fields(['name', 'release_dates.y'])
    .request('/games')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants