Skip to content

Instantly share code, notes, and snippets.

@velotiotech
Created October 8, 2020 10:48
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
import { ObjectId } from 'bson';
import { IResolvers } from 'graphql-tools';
import { IUserProps } from './user.model';
import { UserService } from './user.service';
const userService = new UserService();
export const userResolvers: IResolvers = {
Query: {
User: (_root: unknown, args: { id: ObjectId }) => userService.get(args.id),
//...
},
Mutation: {
createUser: async (_root: unknown, args: IUserProps) => await userService.create(args),
//...
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment