Finished auto role list #134

This commit is contained in:
2023-02-20 18:30:45 +01:00
parent 81fe7433bd
commit a2dcbbc465
20 changed files with 209 additions and 54 deletions

View File

@@ -14,4 +14,30 @@ export class Mutations {
}
}
`;
static createAutoRole = `
mutation updateAutoRole($serverId: ID, $channelId: String, $messageId: String) {
autoRole {
createAutoRole(input: { serverId: $serverId, channelId: $channelId, messageId: $messageId }) {
id
channelId
channelName
messageId
}
}
}
`;
static deleteAutoRole = `
mutation updateAutoRole($id: ID) {
autoRole {
deleteAutoRole(id: $id) {
id
channelId
channelName
messageId
}
}
}
`;
}

View File

@@ -166,6 +166,10 @@ export class Queries {
messageId
autoRoleRuleCount
server {
id
}
createdAt
modifiedAt
}

View File

@@ -2,6 +2,7 @@ import { Server } from "../data/server.model";
import { User } from "../data/user.model";
import { AutoRole } from "../data/auto_role.model";
import { Guild } from "../data/discord.model";
import { Level } from "../data/level.model";
export interface Query {
serverCount: number;
@@ -19,7 +20,7 @@ export interface UserListQuery {
export interface LevelListQuery {
levelCount: number;
levels: User[];
levels: Level[];
}
export interface AutoRoleQuery {

View File

@@ -1,4 +1,10 @@
import { User } from "../data/user.model";
import { AutoRole } from "../data/auto_role.model";
export interface GraphQLResult {
data: any;
errors?: [];
}
export interface QueryResult {
data: any;
@@ -9,3 +15,10 @@ export interface UpdateUserMutationResult {
updateUser: User
};
}
export interface AutoRoleMutationResult {
autoRole: {
createAutoRole?: AutoRole
updateAutoRole?: AutoRole
deleteAutoRole?: AutoRole
};
}