apollographql / apollographql/graphql-subscriptions
Have to publish with subscription name in the object
- Dominant language
- TypeScript
- Stars
- 1.6k
- Forks
- 129
- PR merge metrics
- No merged PRs in 30d
Description
I was following the tutorial in the README file. I noticed if I use
```
// publish to the channel
pubsub.publish('newCommentsChannel', {
id: 123,
content: 'Test',
repoFullName: 'apollostack/GitHunt-API',
posted_by: 'helfer',
});
```
I will get
```
{
data: {
commentAdded: null
}
}
```
But if I publish with the subscription name in the object
```
// publish to the channel
pubsub.publish('newCommentsChannel', {
commentAdded: {
id: 123,
content: 'Test',
repoFullName: 'apollostack/GitHunt-API',
posted_by: 'helfer',
}
});
```
Then I will get the result as in the README.
Am I missing something from the document?
Contributor guide
Research direction
Start with the README's subscription publishing tutorial and compare its pubsub.publish example with the reported result. Check how the channel payload is mapped to the subscription field; done when the README clearly explains whether commentAdded is required and the example matches the documented behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- graphql, node.js, typescript
- Domain
- api, backend-api-design, documentation
- Issue type
- Documentation
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100