How do subscriptions use @Root? #1212
-
In https://github.com/MichalLytek/type-graphql/blob/master/examples/redis-subscriptions/recipe.resolver.ts, the type-graphql/examples/redis-subscriptions/recipe.resolver.ts Lines 56 to 71 in 4fc77f5 I'm having a hard time understanding how a method decorated with type-graphql/examples/redis-subscriptions/examples.gql Lines 29 to 35 in 4fc77f5 @Root seems to imply that you could do something like
someCommentOnARecipieThing {
newComments(recipeId: "2") {
nickname
content
date
}
} Can I get an example of how
In contrast, the |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
I did that 4 years ago, I wouldn't name that now In case of subscriptions, it's the payload from the pub sub - the published message. |
Beta Was this translation helpful? Give feedback.
I did that 4 years ago, I wouldn't name that now
@Root()
😅Some GraphQL tools call it parent, source, root - it's basically the first parameter of the resolver.
In case of subscriptions, it's the payload from the pub sub - the published message.