Subscriptions are sent to HTTPS endpoint and behave like queries
See original GitHub issueThis 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
}
}
}
Issue Analytics
- State:
- Created 5 years ago
- Comments:13 (7 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
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:upgraded to
"graphql-yoga": "^1.14.10",
then ranyarn 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. 😃