From e9559dec08818ebfa3c551cae960ca4cda893ad4 Mon Sep 17 00:00:00 2001 From: Sven Heidemann Date: Wed, 8 Feb 2023 19:08:12 +0100 Subject: [PATCH] Fixed queries #162 --- kdb-bot/src/bot_graphql/abc/data_query_abc.py | 4 ++-- kdb-bot/src/bot_graphql/model/query.gql | 18 +++++++++--------- kdb-bot/src/bot_graphql/model/server.gql | 8 ++++---- .../src/bot_graphql/queries/server_query.py | 2 +- kdb-bot/src/bot_graphql/query.py | 2 +- 5 files changed, 17 insertions(+), 17 deletions(-) diff --git a/kdb-bot/src/bot_graphql/abc/data_query_abc.py b/kdb-bot/src/bot_graphql/abc/data_query_abc.py index 9ab28106..7603a4d2 100644 --- a/kdb-bot/src/bot_graphql/abc/data_query_abc.py +++ b/kdb-bot/src/bot_graphql/abc/data_query_abc.py @@ -7,8 +7,8 @@ class DataQueryABC(QueryABC): def __init__(self, name: str): QueryABC.__init__(self, name) - self.set_field("created_at", self.resolve_created_at) - self.set_field("modified_at", self.resolve_modified_at) + self.set_field("createdAt", self.resolve_created_at) + self.set_field("modifiedAt", self.resolve_modified_at) @staticmethod def resolve_created_at(entry: TableABC, *_): diff --git a/kdb-bot/src/bot_graphql/model/query.gql b/kdb-bot/src/bot_graphql/model/query.gql index c28c5c6d..46f80381 100644 --- a/kdb-bot/src/bot_graphql/model/query.gql +++ b/kdb-bot/src/bot_graphql/model/query.gql @@ -1,28 +1,28 @@ type Query { + autoRoleCount: Int autoRoles(filter: AutoRoleFilter, page: Page, sort: Sort): [AutoRole] - autoRole_count: Int - autoRoleRules(filter: AutoRoleRuleFilter, page: Page, sort: Sort): [AutoRoleRule] autoRoleRuleCount: Int + autoRoleRules(filter: AutoRoleRuleFilter, page: Page, sort: Sort): [AutoRoleRule] - clients(filter: ClientFilter, page: Page, sort: Sort): [Client] clientCount: Int + clients(filter: ClientFilter, page: Page, sort: Sort): [Client] - knownUsers: [KnownUser] knownUserCount: Int + knownUsers: [KnownUser] - levels(filter: LevelFilter, page: Page, sort: Sort): [Level] levelCount: Int + levels(filter: LevelFilter, page: Page, sort: Sort): [Level] - servers(filter: ServerFilter, page: Page, sort: Sort): [Server] serverCount: Int + servers(filter: ServerFilter, page: Page, sort: Sort): [Server] - userJoinedServers(filter: UserJoinedServerFilter, page: Page, sort: Sort): [User] userJoinedServerCount: Int + userJoinedServers(filter: UserJoinedServerFilter, page: Page, sort: Sort): [User] - userJoinedVoiceChannels(filter: UserJoinedVoiceChannelFilter, page: Page, sort: Sort): [User] userJoinedVoiceChannelCount: Int + userJoinedVoiceChannels(filter: UserJoinedVoiceChannelFilter, page: Page, sort: Sort): [User] - users(filter: UserFilter, page: Page, sort: Sort): [User] userCount: Int + users(filter: UserFilter, page: Page, sort: Sort): [User] } \ No newline at end of file diff --git a/kdb-bot/src/bot_graphql/model/server.gql b/kdb-bot/src/bot_graphql/model/server.gql index 659287f7..04047892 100644 --- a/kdb-bot/src/bot_graphql/model/server.gql +++ b/kdb-bot/src/bot_graphql/model/server.gql @@ -3,17 +3,17 @@ type Server implements TableQuery { discordId: String name: String - autoRoles(filter: AutoRoleFilter, page: Page, sort: Sort): [AutoRole] autoRoleCount: Int + autoRoles(filter: AutoRoleFilter, page: Page, sort: Sort): [AutoRole] - clients(filter: ClientFilter, page: Page, sort: Sort): [Client] clientCount: Int + clients(filter: ClientFilter, page: Page, sort: Sort): [Client] - levels(filter: LevelFilter, page: Page, sort: Sort): [Level] levelCount: Int + levels(filter: LevelFilter, page: Page, sort: Sort): [Level] - users(filter: UserFilter, page: Page, sort: Sort): [User] userCount: Int + users(filter: UserFilter, page: Page, sort: Sort): [User] createdAt: String modifiedAt: String diff --git a/kdb-bot/src/bot_graphql/queries/server_query.py b/kdb-bot/src/bot_graphql/queries/server_query.py index 88dfe324..33fff047 100644 --- a/kdb-bot/src/bot_graphql/queries/server_query.py +++ b/kdb-bot/src/bot_graphql/queries/server_query.py @@ -37,7 +37,7 @@ class ServerQuery(DataQueryABC): self.set_field("name", self.resolve_name) self.add_collection( - "auto_role", lambda server, *_: self._auto_roles.get_auto_roles_by_server_id(server.server_id) + "autoRole", lambda server, *_: self._auto_roles.get_auto_roles_by_server_id(server.server_id) ) self.add_collection("client", lambda server, *_: self._clients.get_clients_by_server_id(server.server_id)) self.add_collection("level", lambda server, *_: self._levels.get_levels_by_server_id(server.server_id)) diff --git a/kdb-bot/src/bot_graphql/query.py b/kdb-bot/src/bot_graphql/query.py index e5fd5803..9c574ebc 100644 --- a/kdb-bot/src/bot_graphql/query.py +++ b/kdb-bot/src/bot_graphql/query.py @@ -39,7 +39,7 @@ class Query(QueryABC): self.add_collection("autoRole", lambda *_: self._auto_roles.get_auto_roles(), AutoRoleFilter) self.add_collection("autoRoleRule", lambda *_: self._auto_roles.get_auto_role_rules(), AutoRoleRuleFilter) self.add_collection("client", lambda *_: self._clients.get_clients()) - self.add_collection("knowUser", lambda *_: self._known_users.get_users()) + self.add_collection("knownUser", lambda *_: self._known_users.get_users()) self.add_collection("level", lambda *_: self._levels.get_levels(), LevelFilter) self.add_collection("server", lambda *_: self._servers.get_servers(), ServerFilter) self.add_collection("userJoinedServer", lambda *_: self._user_joined_servers.get_user_joined_servers())