Created
January 21, 2022 09:07
-
-
Save job25721/6729236e2c64a8849288b405753cdddd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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