Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Publish events #91

Closed
anhldbk opened this issue Jul 21, 2017 · 4 comments
Closed

Publish events #91

anhldbk opened this issue Jul 21, 2017 · 4 comments

Comments

@anhldbk
Copy link

anhldbk commented Jul 21, 2017

Hi guys,

In file README, currently we have the demo code to publish events:

pubsub.publish(SOMETHING_CHANGED_TOPIC, { somethingChanged: { id: "123" }});

I tried to use the template above but in clients, I've got nothing. All fields are set to null. But if I modify it a little bit like this:

pubsub.publish(SOMETHING_CHANGED_TOPIC, {  id: "123" });

It works as expected. So is there any thing wrong with the documentation?

@anhldbk
Copy link
Author

anhldbk commented Jul 21, 2017

Well, in src/pubsub.ts:

  public publish(triggerName: string, payload: any): boolean {
    this.ee.emit(triggerName, payload);

    return true;
  }

Definitely I think there's an error in the documentation regarding this issue.

@rnenjoy
Copy link

rnenjoy commented Jul 21, 2017

If i dont have { somethignChanged: .... i get null. So i have the opposite?

@anhldbk
Copy link
Author

anhldbk commented Jul 22, 2017

@rnenjoy I don't know. What're your related packages? Mine are:

    "apollo-client": "^1.9.0-1",
    "graphql-tag": "^2.4.2",
    "react-apollo": "^1.4.7",
    "subscriptions-transport-ws": "^0.8.1"

@grantwwu grantwwu added the bug label Sep 27, 2018
@grantwwu
Copy link
Contributor

It's been a while since this bug was reported. If you're still encountering this, please reply... and a working reproducer would also be nice :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants