import {Resolver, Subscription} from '@nestjs/graphql'
import {PersonService} from '../person.service'
import {Person} from '../models/Person'

import { pubsub } from '../../main'

@Resolver(() => Person)
export class PersonResolverS {
  constructor(
    private readonly service: PersonService,
  ) {}

  @Subscription(returns => Person,{})
  async PersonUpdated() {
    return pubsub.asyncIterator('PersonUpdated');
  }
}
