Skip to content

Support for SSE event streams in Strawberry Shake #8555

@jimitndiaye

Description

@jimitndiaye

Product

Strawberry Shake

Is your feature request related to a problem?

How do you configure Strawberryshake to use SSE correctly? I'm having trouble with the websocket transport in my deployed app (it is working fine locally) so I'm trying SSE instead but while it works on the wire level (and in Nitro) strawberry shake does not respond to the individual messages/events - it just keeps waiting even though i can see messages coming through. The same setup works fine when switched to websocket.

Here is my .graphqlrc

{
  "schema": "schema.graphql",
  "documents": "**/*.graphql",
  "extensions": {
    "strawberryShake": {
      "name": "GraphQLClient",
      "namespace": "TK.Dialogs.Portal.Modules.Tenant.Client.GraphQL",
      "url": "<https://localhost:7201/dev/graphql>",
      "dependencyInjection": true,
      "records": {
        "inputs": true,
        "entities": true
      },
      "transportProfiles": [
        {
          "name": "Default",
          "default": "HTTP",
          "subscription": "WebSocket"
        },
        {
          "name": "SSE",
          "default": "HTTP",
          "subscription": "HTTP"
        }
      ]
    }
  }
}
Image

As you can see in the screenshot messages are coming through but the strawberryshake client does not react to them whereas when I swap the websocket protocol with the same code everything works.
Slack Message

The solution you'd like

I wish the SSE transport worked exactly like the Websocket transport with the strawberry shake client responding to individual messages

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions