import { Controller, Get } from '@nestjs/common'; import { Query } from '@nestjs/graphql'; import { EventsService } from './events.service'; import { EventEntity } from './events.entity'; @Controller('/api/events') export class EventsController { constructor( private readonly eventsService: EventsService ){} @Get("/") @Query(()=>[EventEntity]) async events(): Promise{ return await this.eventsService.getEvents(); } }