Skip to content

Commit

Permalink
fix(examples): fix examples (#31)
Browse files Browse the repository at this point in the history
  • Loading branch information
goldcaddy77 authored Jan 20, 2019
1 parent ae0ae2f commit d04d805
Show file tree
Hide file tree
Showing 6 changed files with 343 additions and 22 deletions.
5 changes: 3 additions & 2 deletions examples/1-simple-model/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"db:drop": "dropdbjs $(dotenv -p TYPEORM_DATABASE) 2>&1 || :",
"playground:open": "open http://localhost:$(dotenv -p APP_PORT)/graphql",
"start": "npm-run-all --parallel start:ts playground:open",
"start:ts": "ts-node --type-check src/index.ts",
"start:ts": "ts-node-dev --type-check src/index.ts",
"watch:ts": "nodemon -e ts,graphql -x ts-node --type-check src/index.ts"
},
"dependencies": {
Expand All @@ -28,7 +28,8 @@
"nodemon": "^1.18.9",
"npm-run-all": "^4.1.5",
"ts-jest": "^23.10.5",
"ts-node": "^7.0.1"
"ts-node": "^7.0.1",
"ts-node-dev": "^1.0.0-pre.32"
},
"jest": {
"transform": {
Expand Down
6 changes: 3 additions & 3 deletions examples/1-simple-model/src/user.resolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,19 +32,19 @@ export class UserResolver extends BaseResolver<User> {

@Mutation(returns => User)
async createUser(@Arg('data') data: UserCreateInput, @Ctx() ctx: BaseContext): Promise<User> {
return this.create(data, ctx.user.id);
return this.create(data, 'fakeid1');
}

@Mutation(returns => User)
async updateUser(@Args() { data, where }: UserUpdateArgs, @Ctx() ctx: BaseContext): Promise<User> {
return this.update(data, where, ctx.user.id);
return this.update(data, where, 'fakeid1');
}

@Mutation(returns => StandardDeleteResponse)
async deleteUser(
@Arg('where') where: UserWhereUniqueInput,
@Ctx() ctx: BaseContext
): Promise<StandardDeleteResponse> {
return this.delete(where, ctx.user.id);
return this.delete(where, 'fakeid1');
}
}
Loading

0 comments on commit d04d805

Please sign in to comment.