question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Subscriptions are sent to HTTPS endpoint and behave like queries

See original GitHub issue

This issue pertains to the following package(s):

  • GraphQL Playground - Electron App

What OS and OS version are you experiencing the issue(s) on?

Mac OS X Sierra

What version of graphql-playground(-electron/-middleware) are you experiencing the issue(s) on?

1.5.4.

What is the expected behavior?

Running a subscription sets up an active WS connection that listes to events. Whenever an event is fired, the Playground shows the related data according to the subscription query.

What is the actual behavior?

Running a subscription sends a HTTPS request, which gets an immediate response. No active listening happens.

What steps may we take to reproduce the behavior?

prisma init test
cd test
prisma deploy
prisma playground
subscription {
  user(where: {
    mutation_in: [CREATED, UPDATED, DELETED]
  }) {
    mutation
    node {
      id
      name
    }
    updatedFields
    previousValues {
      id
    }
  }
}

subscription-as-a-query

Issue Analytics

  • State:open
  • Created 5 years ago
  • Comments:13 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
nikolasburkcommented, Apr 19, 2018

Thanks for reporting this Nilan! As a temporary workaround, I’ve found that it often helps to start a subscription on the database layer (which seems to work reliably). So, e.g. for a Post model, it could look like this:

subscription {
  post {
    node {
      id
      title
    }
  }
}

image

1reaction
captDaylightcommented, Jun 20, 2018

upgraded to "graphql-yoga": "^1.14.10", then ran yarn dev to start the playground again. Still getting the null subscription data though and the playground settings from cog wheel still look like my reference above.

Not the end of the world, the work around is works for me. I don’t want you to have to spin your wheels helping me get it up to speed. 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Subscriptions are sent to HTTPS endpoint and behave like ...
Running a subscription sets up an active WS connection that listes to events. Whenever an event is fired, the Playground shows the related...
Read more >
Fanout to HTTP/S endpoints
When you subscribe an endpoint to a topic, you can publish a notification to the topic and Amazon SNS sends an HTTP POST...
Read more >
Subscriptions - Apollo GraphQL Docs
Like queries, subscriptions enable you to fetch data. Unlike queries, subscriptions are long-lasting operations that can change their result over time. They can ......
Read more >
Sending Amazon SNS Messages to HTTPS Endpoints
Before you subscribe your HTTPS endpoint to a topic, you must make sure that the HTTPS endpoint has the capability to handle the...
Read more >
Subscriptions and Live Queries - Real Time with GraphQL
A subscription operation looks similar to this. ... executed resolvers in the resolver/type tree behave like normal query resolvers.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found