Skip to content

Subscriptions and interfaces #174

Answered by theogravity
theogravity asked this question in Q&A
Discussion options

You must be logged in to vote

They're actually instances of the classes. It seems I can't remove isTypeOf without removing the interfaces property. If I remove both, the event types do not implement anything in the generated schema.

But, I think I figured out what's going on. I noticed this behavior too when it came to writing the subscribe function in our apollo server.

The value passed to isTypeOf is serialized to an object. When I console.logged out the event in isTypeOf, it was a pure object. I wonder if the serialization is a native gql thing or specific to the pubsub lib being used.

We actually add in an eventType property in our events, and so when I compared that property, it works!

  isTypeOf: (value) => {
  …

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
2 replies
@hayes
Comment options

@hayes
Comment options

Comment options

You must be logged in to vote
1 reply
@hayes
Comment options

Answer selected by theogravity
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants