Skip to content

Have to publish with subscription name in the object #51

@AnthonyCC

Description

@AnthonyCC

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationStrictly about documentationgood first issueIssues that are suitable for first-time contributors.help wanted

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions