ghostdogpr / caliban

Functional GraphQL library for Scala

Home Page:https://ghostdogpr.github.io/caliban/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ConnectionInit in GraphQLTransportWS returns faulty message upon error

SvenW opened this issue · comments

https://github.com/ghostdogpr/caliban/blob/52540e3d8dc9200443054dc57e23ce76ca02fe44/interop/tapir/src/main/scala/caliban/interop/tapir/ws/Protocol.scala#L76C52-L80

If the beforeInit Webhook returns an error it seems that the protocol is broken since the connection_init message doesn't contain an id. In order for it to work correctly it would need to set the id field as well as per the spec.

interface ErrorMessage {
  id: '<unique-operation-id>';
  type: 'error';
  payload: GraphQLError[];
}