Last active
October 9, 2020 05:11
-
-
Save velotiotech/235e4a1a65a1728b5c441e73655e1841 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 { Arg, Ctx, Mutation, Resolver } from 'type-graphql'; | |
import { User } from './user.model'; | |
import { UserService } from './user.service'; | |
@Resolver(_of => User) | |
export class UserResolver { | |
private __userService: UserService; | |
constructor() { | |
this.__userService = new UserService(); | |
} | |
@Mutation(_returns => User) | |
async createUser(@Arg('data', type => UserCreateInput) data: UserCreateInput, @Ctx() ctx: any) { | |
return this.__userService.create(data) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment