-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Summary
Implement the missing Encounter.fightRankings GraphQL field to provide encounter-specific fight ranking data with advanced filtering options.
Background
The GraphQL schema exposes Encounter.fightRankings with parameters including:
hardModeLevel: HardModeLevelRankFilter- Filter by specific hard mode levelsleaderboard: LeaderboardRank- Include/exclude ranks without backing logsmetric: FightRankingMetricType- Different metrics than character rankings
This complements the character rankings and provides fight-level analysis capabilities.
Current State
- We have various ranking methods but none that access fight-specific rankings at the encounter level
- This data is useful for analyzing group/raid performance rather than individual performance
Implementation Steps
1. Add the GraphQL Query
Create a new query in queries.graphql:
query getEncounterFightRankings(
$zoneId: Int\!
$encounterId: Int\!
$bracket: Int
$difficulty: Int
$filter: String
$page: Int
$partition: Int
$serverRegion: String
$serverSlug: String
$size: Int
$leaderboard: LeaderboardRank
$hardModeLevel: HardModeLevelRankFilter
$metric: FightRankingMetricType
) {
worldData {
zone(id: $zoneId) {
encounters {
id
name
fightRankings(
bracket: $bracket
difficulty: $difficulty
filter: $filter
page: $page
partition: $partition
serverRegion: $serverRegion
serverSlug: $serverSlug
size: $size
leaderboard: $leaderboard
hardModeLevel: $hardModeLevel
metric: $metric
)
}
}
}
}2. Update Code Generation
- Add the query to the code generation input
- Run the code generation to create the response types
- This will generate
GetEncounterFightRankingsresponse class
3. Create the Client Method
Add to WorldDataMixin or create a new RankingsMixin:
async def get_encounter_fight_rankings(
self,
zone_id: int,
encounter_id: int,
bracket: Optional[int] = None,
difficulty: Optional[int] = None,
filter: Optional[str] = None,
page: Optional[int] = None,
partition: Optional[int] = None,
server_region: Optional[str] = None,
server_slug: Optional[str] = None,
size: Optional[int] = None,
leaderboard: Optional[LeaderboardRank] = None,
hard_mode_level: Optional[HardModeLevelRankFilter] = None,
metric: Optional[FightRankingMetricType] = None,
) -> GetEncounterFightRankings:
"""
Get fight rankings for a specific encounter.
This provides fight-level (group/raid) rankings as opposed to
individual character rankings. Useful for analyzing overall
group performance and completion times.
Args:
zone_id: The zone ID containing the encounter
encounter_id: The specific encounter ID
leaderboard: Filter by leaderboard rank type
hard_mode_level: Filter by hard mode difficulty level
metric: The ranking metric to use (default, speed, execution, etc.)
Returns:
Fight ranking data for the specified encounter
"""
# Implementation4. Response Processing
Similar to character rankings:
- Filter encounters list to find the matching encounter_id
- Extract the fightRankings from that specific encounter
- Provide clear error messages if encounter not found
5. Add Comprehensive Tests
- Unit tests for all parameters
- Integration tests verifying the filters work
- Test edge cases (invalid encounter, no rankings available)
6. Documentation Updates
- Add to API reference under a new "Advanced Rankings" section
- Provide examples showing fight vs character ranking differences
- Use cases for when to use each type of ranking
Technical Considerations
- This uses
FightRankingMetricTypeenum (different from character rankings) - Fight rankings represent group/raid performance, not individual
- May need to handle pagination differently than character rankings
Acceptance Criteria
- Method successfully retrieves fight rankings for specific encounters
- Hard mode level filtering works correctly
- Leaderboard filtering works as expected
- Clear documentation distinguishes this from character rankings
- Integration tests verify real API behavior
- Error handling for invalid zone/encounter combinations
Priority
High - Completes the missing ranking functionality for true 100% API coverage
Related Issues
- Implement Encounter.characterRankings with advanced filtering options #47 - Implement Encounter.characterRankings (companion issue)
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request