title: Graphql subscriptions - Subscription field must return Async Iterable. Received: undefined when using withFilter
body: <p>I have an app that uses graphql subscriptions for chat functionality. I have managed to successfully get the subscription working however after introducing the <code>withFilter</code> function in order to filter which clients the messages get sent to I am getting the following error on the frontend:</p>
  
  <blockquote>
    <p>Subscription field must return Async Iterable. Received: undefined</p>
  </blockquote>
  
  <p>Here is my subscription resolver:</p>
  
  <pre><code>const { PubSub, withFilter } = require('graphql-yoga');
  
  const pubsub = new PubSub();
  pubsub.ee.setMaxListeners(30);
  
  const Subscription = {
    detailedConversation: withFilter(
      () =&gt; pubsub.asyncIterator('detailedConversation'),
      (payload, args) =&gt; {
        return true;
      }
    )
  };
  
  module.exports = {
    Subscription,
    pubsub
  };
  </code></pre>
  
  <p>As the second parameter of withFilter has to be a function that returns a boolean, I have just set this to return true for the time being. </p>
  
  <p>Graphql-yoga uses graphql-subscriptions under the hood and after reading the documentation on implementation <a href="https://github.com/apollographql/graphql-subscriptions#filters" rel="nofollow noreferrer">here</a> I can't see what i'm doing wrong?</p>
  
  <p>FYI the error occurs when attempting to subscribe for the first time to a conversation, not whilst sending a message or anything</p>