Skip to content

Commit d43d778

Browse files
authored
docs(subscriptions): fix pubSub.publish code example (#1710)
Typegraphql 2.0.0 doesn't provide PubSub decorator. it provide only an interface. The code example should call pubSub instance created before to publish a notification.
1 parent 22e38ac commit d43d778

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docs/subscriptions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ import { pubSub } from "./pubsub";
147147
class SampleResolver {
148148
// ...
149149
@Mutation(returns => Boolean)
150-
async addNewComment(@Arg("comment") input: CommentInput, @PubSub() pubSub: PubSubEngine) {
150+
async addNewComment(@Arg("comment") input: CommentInput) {
151151
const comment = this.commentsService.createNew(input);
152152
await this.commentsRepository.save(comment);
153153
// Trigger subscriptions topics

0 commit comments

Comments
 (0)