5

Insomnia now supports WebSockets. Therefore I was hoping that I can also use it to test GraphQL Subscriptions, since they are also using WebSockets.

I created a GraphQL request to open a new Subscription, but I always get the following response:

{
    "errors": [
        {
            "message": "The response type is not supported."
        }
    ]
}

Am I doing something wrong or are GraphQL Subscriptions simply not a feature in Insomnia?

I checked the Insomnia WebSocket Docs as well as the Insomnia GraphQL Queries Docs but couldn't find any info regarding this topic.

eddex
  • 1,622
  • 1
  • 15
  • 37

1 Answers1

0

The following solution worked for me, though it is far from ideal. I use Apollo Server and prefer to use the build in Playground for subscriptions.

The template of a subscription looks like this:

subscription UserCreated {
  userCreated {
    id,
    firstName,
    lastName
  }
}

You can then use the "repeat on interval" when using the Send button:

enter image description here

rhazen
  • 173
  • 8