/**
 * @aurora-catalyst-generated
 * @source cliter/o-auth/scope.aurora.yaml
 */
import { OAuthScope } from '@api/graphql';
import { OAuthFindScopeByIdHandler } from '@app/o-auth/scope';
import { Auth } from '@aurora/decorators';
import { Timezone } from '@aurorajs.dev/core-back';
import { QueryStatement } from '@aurorajs.dev/core-common';
import { Args, Query, Resolver } from '@nestjs/graphql';

@Resolver()
@Auth('oAuth.scope.get')
export class OAuthFindScopeByIdResolver {
  constructor(private readonly handler: OAuthFindScopeByIdHandler) {}

  @Query('oAuthFindScopeById')
  async main(
    @Args('id') id: string,
    @Args('constraint') constraint?: QueryStatement,
    @Timezone() timezone?: string,
  ): Promise<OAuthScope> {
    return await this.handler.main(id, constraint, {
      timezone,
    });
  }
}
