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

feat: add function to retrieve recently played games #134

Merged
merged 15 commits into from
Mar 14, 2023

Conversation

evanshortiss
Copy link
Contributor

I had been relying on the trophy titles endpoint/functions to find my recently played games. I noticed this approach wasn't accurate since I don't always unlock a trophy when playing a given game.

This PR provides an alternative that appears to be based purely on activity. It uses a GraphQL endpoint that has persisted queries enabled, so it might be a little tedious to support if PSN makes changes to their GraphQL queries/schemas.

LMK what you think. I'm happy to make changes to keep the code more aligned with the existing style etc.

@vercel
Copy link

vercel bot commented Mar 11, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated
psn-api ✅ Ready (Inspect) Visit Preview 💬 Add your feedback Mar 14, 2023 at 4:51AM (UTC)

@wescopeland
Copy link
Member

Yo!

Briefly skimming, it looks like a huge yarn.lock update made it into the PR. I just pulled the latest and ran yarn and ensured nothing changed in the yarn.lock. Any idea what happened here?

@wescopeland
Copy link
Member

wescopeland commented Mar 11, 2023

Looks like Prettier and possibly ESLint did not run. Can you do yarn format:write and yarn lint:fix to auto-resolve most (if not all) styling and semantic issues?

yarn verify should ensure checks pass. I am unclear why proper checks aren't running on the PR itself- maybe I have an unpaid GitHub bill 😆

Copy link
Member

@wescopeland wescopeland left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good work. I have a few comments here, but they are mostly minor.

We will also need to update README.md, as well as the Docusaurus site. You can spin up the Docusaurus site by cding into the website directory, installing deps with yarn, and then executing yarn start.

The main structural change I believe that needs to happen in this PR is the creation of a src/graphql folder and the migration of the new stuff into there.

src/user/USER_BASE_URL.ts Outdated Show resolved Hide resolved
src/models/user-game-list-response.model.ts Outdated Show resolved Hide resolved
src/models/user-game-list-response.model.ts Outdated Show resolved Hide resolved
src/models/user-game-list-response.model.ts Outdated Show resolved Hide resolved
src/user/getUserGameList.test.ts Outdated Show resolved Hide resolved
src/user/getUserGameList.ts Outdated Show resolved Hide resolved
src/user/getUserGameList.ts Outdated Show resolved Hide resolved
src/user/getUserGameList.ts Outdated Show resolved Hide resolved
src/user/getUserGameList.test.ts Outdated Show resolved Hide resolved
evanshortiss and others added 2 commits March 11, 2023 16:02
Co-authored-by: Wes Copeland <wlcopeland1@gmail.com>
Co-authored-by: Wes Copeland <wlcopeland1@gmail.com>
Co-authored-by: Wes Copeland <wlcopeland1@gmail.com>
@evanshortiss
Copy link
Contributor Author

Alrighty, I think I've addressed alot of whats mentioned here. I'm sure there's some other minor things I might have missed, or need tweaking, so LMK 😄

@wescopeland
Copy link
Member

Looking good! I think the last thing we're missing is a small addition to README.md which will contain a direct URL to the new docs.

I believe the URL will be:
https://psn-api.achievements.app/api-docs/users#getrecentlyplayedgames

chore: refactor getRecentlyPlayedGames test
doc: update readme with getRecentlyPlayedGames
@evanshortiss
Copy link
Contributor Author

Almost there! Addressed the newest comments 😄

@wescopeland
Copy link
Member

@all-contributors please add @evanshortiss for code and documentation

Copy link
Member

@wescopeland wescopeland left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work! Thank you for your contribution to psn-api. I have updated the contributors in the README.md file accordingly.

@allcontributors
Copy link
Contributor

@wescopeland

I've put up a pull request to add @evanshortiss! 🎉

@wescopeland wescopeland merged commit 9846d3a into achievements-app:main Mar 14, 2023
@github-actions
Copy link

🎉 This PR is included in version 2.9.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Successfully merging this pull request may close these issues.

2 participants