absinthe_graphql_ws icon indicating copy to clipboard operation
absinthe_graphql_ws copied to clipboard

Add an ability to return payload on handle_init error

Open nikitalocalhost opened this issue 2 years ago • 1 comments

graphql-ws expects ErrorMessage on error, and Absinthe.GraphqlWS.Message.Error supports providing it, but Absinthe.GraphqlWS.Transport.handle_inbound uses handle_init callback return only as error id.

I think this library has two paths to resolve this:

  1. Add possibility to add payload provided by developer (expect handle_init return something like {:error, {id, payload}, socket})
  2. Generate error inside this library

nikitalocalhost avatar Dec 01 '23 17:12 nikitalocalhost

Stupid patch doesn't work

nikitalocalhost avatar Dec 01 '23 18:12 nikitalocalhost