Skip to content

Commit 028233a

Browse files
committed
bugfix(sample): fix graphql sample bug (nestjs#3237)
create cat having property named id
1 parent 91a4639 commit 028233a

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

sample/12-graphql-apollo/src/cats/cats.service.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ export class CatsService {
66
private readonly cats: Cat[] = [{ id: 1, name: 'Cat', age: 5 }];
77

88
create(cat: Cat): Cat {
9+
cat.id = this.cats.length + 1;
910
this.cats.push(cat);
1011
return cat;
1112
}

0 commit comments

Comments
 (0)