Skip to content

Instantly share code, notes, and snippets.

@job25721
Created January 21, 2022 09:07
Show Gist options
  • Save job25721/6729236e2c64a8849288b405753cdddd to your computer and use it in GitHub Desktop.
Save job25721/6729236e2c64a8849288b405753cdddd to your computer and use it in GitHub Desktop.
import { Query, Resolver } from '@nestjs/graphql';
import { User } from './user.schema';
import { UserSerivce } from './user.service';
@Resolver(() => User)
export class UserResolver {
constructor(private readonly userService: UserSerivce) {}
@Query(() => String)
helloWorld() {
return this.userService.helloWorld();
}
@Query(() => [User])
getUsers() {
return this.userService.getUsers();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment