/**
 * @aurora-catalyst-generated
 * @source cliter/o-auth/application-client.aurora.yaml
 */
import { OAuthApplicationClient } from '@api/graphql';
import { OAuthDeleteApplicationsClientsHandler } from '@app/o-auth/application-client';
import { Auth } from '@aurora/decorators';
import { Auditing, AuditingMeta, Timezone } from '@aurorajs.dev/core-back';
import { QueryStatement } from '@aurorajs.dev/core-common';
import { Args, Mutation, Resolver } from '@nestjs/graphql';

@Resolver()
@Auth('oAuth.applicationClient.delete')
export class OAuthDeleteApplicationsClientsResolver {
  constructor(private readonly handler: OAuthDeleteApplicationsClientsHandler) {}

  @Mutation('oAuthDeleteApplicationsClients')
  async main(
    @Args('query') queryStatement?: QueryStatement,
    @Args('constraint') constraint?: QueryStatement,
    @Timezone() timezone?: string,
    @Auditing() auditing?: AuditingMeta,
  ): Promise<OAuthApplicationClient[]> {
    return await this.handler.main(queryStatement, constraint, {
      timezone,
      repositoryOptions: { auditing },
    });
  }
}
