title: Ariadne GraphQL Subscriptions: "Could not connect to websocket endpoint ws://localhost:3001/"
body: <p>I was following this twilio blog on graphql subscriptions using <code>ariadine</code>. But when itry to make a subscription in the playground im getting the error:</p>
  <pre class="lang-json prettyprint-override"><code>{
    &quot;error&quot;: &quot;Could not connect to websocket endpoint ws://localhost:3001/. Please check if the endpoint url is correct.&quot;
  }
  </code></pre>
  <p>Here is the subscription that I'm sending</p>
  <pre><code>subscription {
    post {
      error {
        message
        field
      }
      post {
        postId
        createdAt
        caption
      }
    }
  }
  </code></pre>
  <p>here are my typedefs</p>
  <pre><code>schema {
    query: Query
    mutation: Mutation
    subscription: Subscription
  }
  
  input PostInput {
    caption: String!
  }
  
  type Post {
    postId: String!
    createdAt: String!
    caption: String!
  }
  
  type ErrorType {
    field: String!
    message: String!
  }
  
  type PostResponse {
    error: ErrorType
    post: Post
  }
  type Mutation {
    createPost(input: PostInput!): PostResponse!
  }
  
  type Subscription {
    post: PostResponse
  }
  
  </code></pre>
  <p>Here is my resolvers.</p>
  <ol>
  <li>mutations</li>
  </ol>
  <pre class="lang-py prettyprint-override"><code>@mutation.field(&quot;createPost&quot;)
  async def create_post_resolver(obj, info, input):
      try:
          post = Post(postId=uuid4(), caption=input[&quot;caption&quot;])
          db.session.add(post)
          db.session.commit()
          for queue in queues:
              queue.put(post)  
              
          return{
              &quot;error&quot;: None,
              &quot;post&quot;: post
          }
      except Exception as e:
          return{
              &quot;error&quot;: {&quot;message&quot;:str(e), &quot;field&quot;: &quot;unknown&quot;},
              &quot;post&quot;: None
          }
  </code></pre>
  <ol start="2">
  <li>subscriptions</li>
  </ol>
  <pre class="lang-py prettyprint-override"><code>@subscription.source(&quot;post&quot;)
  async def posts_source(obj, info):
      queue = asyncio.Queue(maxsize=0)
      queues.append(queue)
      try:
          while True:
              post = await queue.get()
              queue.task_done()
              payload = {
                  &quot;post&quot;: post,
                  &quot;error&quot;: None
              }
              yield payload
      except asyncio.CancelledError:
          queues.remove(queue)
          raise
  
  @subscription.field(&quot;post&quot;)
  async def posts_resolver(payload, info):
      return payload
  </code></pre>
  <p>What maybe possibly the cause of this error.</p>