GraphQL Part1 (gql endpoint only) #162 #192
@ -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, *_):
|
||||
|
@ -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]
|
||||
}
|
@ -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
|
||||
|
@ -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))
|
||||
|
@ -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())
|
||||
|
Loading…
Reference in New Issue
Block a user