From 4a763e4e033f43f7e9453bd5c1bb9122440a411b Mon Sep 17 00:00:00 2001 From: Sven Heidemann Date: Thu, 28 Sep 2023 10:44:09 +0200 Subject: [PATCH] Added position query #378 --- kdb-bot/src/bot_graphql/graphql/query.gql | 1 + kdb-bot/src/bot_graphql/query.py | 2 ++ 2 files changed, 3 insertions(+) diff --git a/kdb-bot/src/bot_graphql/graphql/query.gql b/kdb-bot/src/bot_graphql/graphql/query.gql index 96b63713..8946e9a9 100644 --- a/kdb-bot/src/bot_graphql/graphql/query.gql +++ b/kdb-bot/src/bot_graphql/graphql/query.gql @@ -39,6 +39,7 @@ type Query { shortRoleNameCount: Int shortRoleNames(filter: ShortRoleNameFilter, page: Page, sort: Sort): [ShortRoleName] + shortRoleNamePositions: [String] technicianConfig: TechnicianConfig possibleFeatureFlags: [String] diff --git a/kdb-bot/src/bot_graphql/query.py b/kdb-bot/src/bot_graphql/query.py index 2acb68a9..abde5cb0 100644 --- a/kdb-bot/src/bot_graphql/query.py +++ b/kdb-bot/src/bot_graphql/query.py @@ -15,6 +15,7 @@ from bot_data.abc.user_joined_game_server_repository_abc import UserJoinedGameSe from bot_data.abc.user_joined_server_repository_abc import UserJoinedServerRepositoryABC from bot_data.abc.user_joined_voice_channel_repository_abc import UserJoinedVoiceChannelRepositoryABC from bot_data.abc.user_repository_abc import UserRepositoryABC +from bot_data.model.short_role_name_position_enum import ShortRoleNamePositionEnum from bot_graphql.abc.query_abc import QueryABC from bot_graphql.filter.achievement_filter import AchievementFilter from bot_graphql.filter.auto_role_filter import AutoRoleFilter @@ -80,5 +81,6 @@ class Query(QueryABC): self.set_field("achievementAttributes", lambda *_: achievement_service.get_attributes()) self.set_field("achievementOperators", lambda *_: achievement_service.get_operators()) + self.set_field("shortRoleNamePositions", lambda *_: [x.value for x in ShortRoleNamePositionEnum]) self.set_field("possibleFeatureFlags", lambda *_: [e.value for e in FeatureFlagsEnum]) self.set_field("discord", lambda *_: Discord(bot.guilds, List(any).extend(bot.users)))