Heroic-Games-Launcher / HeroicGamesLauncher

A games launcher for GOG, Amazon and Epic Games for Linux, Windows and macOS.
https://heroicgameslauncher.com
GNU General Public License v3.0
7.91k stars 417 forks source link

[Feature] Get achivements via epic graphql #2382

Open Nocccer opened 1 year ago

Nocccer commented 1 year ago

Problem description

With the graphql we can fetch all achivements epic provides for a game and also all achivements a user finished.

Feature description

Implement the fetch of achivments via graphql.

Alternatives

No response

Additional information

Etaash-mathamsetty commented 1 year ago

is it possible to know if a user has unlocked a certain achievement?

Lariaa commented 1 year ago

is it possible to know if a user has unlocked a certain achievement?

The PlayerAchievement operation will give you something like


{
    "data": {
        "PlayerProfile": {
            "playerProfile": {
                "epicAccountId": "<accountid>",
                "displayName": "DISPLAYNAME",
                "relationship": "SELF",
                "avatar": {
                    "small": "https://shared-static-prod.epicgames.com/epic-profile-icon//n/icon.png?size=64",
                    "medium": "https://shared-static-prod.epicgames.com/epic-profile-icon//n/icon.png?size=128",
                    "large": "https://shared-static-prod.epicgames.com/epic-profile-icon//n/icon.png?size=512"
                },
                "productAchievements": {
                    "data": {
                        "epicAccountId": "<accountid>",
                        "sandboxId": "79d9bff700bb46a790b21e8c73b34899",
                        "totalXP": 20,
                        "totalUnlocked": 2,
                        "achievementSets": [{
                            "achievementSetId": "7f6ck5n",
                            "isBase": true,
                            "totalUnlocked": 2,
                            "totalXP": 20
                        }],
                        "playerAwards": [],
                        "playerAchievements": [{
                            "playerAchievement": {
                                "achievementName": "FIND_SANCTUARY",
                                "epicAccountId": "<accountid>",
                                "progress": 1,
                                "sandboxId": "79d9bff700bb46a790b21e8c73b34899",
                                "unlocked": true,
                                "unlockDate": "2022-05-22T07:39:26.283Z",
                                "XP": 10,
                                "achievementSetId": "7f6ck5n",
                                "isBase": true
                            }
                        }, {
                            "playerAchievement": {
                                "achievementName": "THE_THREE",
                                "epicAccountId": "<accountid>",
                                "progress": 1,
                                "sandboxId": "79d9bff700bb46a790b21e8c73b34899",
                                "unlocked": true,
                                "unlockDate": "2022-05-22T07:37:40.480Z",
                                "XP": 10,
                                "achievementSetId": "7f6ck5n",
                                "isBase": true
                            }
                        }]
                    }
                }
            }
        }
    },
    "extensions": {}
}