Skip to content

Keep-Alive messages trigger errors #383

Open
@cheina97

Description

@cheina97

Describe the bug
I'm using the client generated by genClient with Hasura and have noticed that subscriptions are failing.
The problem is that Hasura implements keep-alive messages for the 'graphql-transport-ws' and 'graphql-ws' protocols. In the former case, it sends 'ping' messages; in the latter, 'ka' messages. Neither of these messages includes an ID, which triggers the following error: https://github.com/cheina97/genqlient/blob/6309a6ef5f325d254be1a91756b56fd9ec5441a3/graphql/websocket.go#L143-L145.

I have two possible solutions (I tested both and they work):

Do you have any other suggestions? I can open a PR and implement it.

I'm also aware that genqlient should implement a response to these messages. Do you think it would be feasible to implement this in the next PR?

To Reproduce
Deploy Hasura and try genqlient with it.

Expected behavior
Subscriptions should work with hasura graphql server.

genqlient version
v0.8.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions