mirror of
https://github.com/IT4Change/gradido.git
synced 2026-03-01 12:44:43 +00:00
20 lines
689 B
TypeScript
20 lines
689 B
TypeScript
// backend/src/graphql/resolver/CommandResolver.ts
|
|
import { Resolver, Mutation, Arg, Ctx } from 'type-graphql';
|
|
import { CommandExecutor } from '../../command/CommandExecutor';
|
|
import { CommandResult } from '../model/CommandResult';
|
|
|
|
@Resolver()
|
|
export class CommandResolver {
|
|
private commandExecutor = new CommandExecutor();
|
|
|
|
@Mutation(() => CommandResult)
|
|
async executeCommand(
|
|
@Arg('encryptedArgs', () => Object) encryptedArgs: any,
|
|
@Ctx() context: any
|
|
): Promise<CommandResult> {
|
|
// Convert to EncryptedTransferArgs if needed
|
|
const result = await this.commandExecutor.executeEncryptedCommand(encryptedArgs);
|
|
return result as unknown as CommandResult;
|
|
}
|
|
}
|