igihcksn / mypocketmonsters

https://mypocketmonsters.vercel.app
1 stars 15 forks source link

Add version game section to detail pokemon #12

Closed igihcksn closed 2 years ago

igihcksn commented 2 years ago

This issue is to show game version with the logo in detail page as response from api pokemon detail

cgilroy commented 2 years ago

Hi @igihcksn, I can help with this one! Would you mind assigning me? Thanks!

igihcksn commented 2 years ago

Yes sure @cgilroy let me know if u have done with this issue, don't forget to attach the screenshot, thank you

cgilroy commented 2 years ago

Something strange I'm noticing is the version data for a pokemon always a name: 'hp' value. Can you reproduce this @igihcksn? I'm wondering if the GraphQL API is sending bad data, though the query does work well here... 🤔
image

cgilroy commented 2 years ago

I just noticed if I change things in the useQuery in details.js to not use the cache, then I get the correct name attribute. I don't understand the Apollo cache very well, but I wonder if doing this is okay?

const PokeCommonData = useQuery(QUERY.GET_POKEMON_BY_NAME, {
  fetchPolicy: "no-cache",
  variables: {
      name: slug
  }
});
igihcksn commented 2 years ago

Good news, yes u can change it after that i'll try change in my local

cgilroy commented 2 years ago

Now that we can grab the correct game name attribute, I noticed that you'd like the game logos to be shown. It doesn't look like the API provides game logo images, so do you know where we could get these? If we can't get the images from an API, we'd have to download all of them and map them out to the names provided by the API. This would be a pretty large chunk of work, and would require manual updates for future game releases.

igihcksn commented 2 years ago

Yes @cgilroy we need add the logos at asset folder then add the constant to get the logos base on the name from the api, so its still need manually process, but don't worry if there is update from the api i'll check it