oliyh / re-graph

A graphql client for clojurescript and clojure
460 stars 39 forks source link

Fix typo in re-init example #74

Closed polymeris closed 3 years ago

polymeris commented 3 years ago

At least I think it's a typo, it wouldn't work for me otherwise.

oliyh commented 3 years ago

Hi @polymeris The two are intentionally not equivalent - the http one will send those http headers, whereas the websocket one will send that map as the connection init payload once the websocket is already connected. When you say it didn't work, what do you mean?

polymeris commented 3 years ago

I meant the server I am using (hasura) seems to expect the connection_init payload to contain a headers key with Authorization:

Screenshot from 2020-08-15 11-25-32

But maybe that's not standard (or there is no standard), IDK.

oliyh commented 3 years ago

Hi, Oh right, I didn't know that. Lacinia, that I use most, let's you handle the connection init however you want so we just use a payload like {:token "abc123"}. Perhaps the example should either make them identical or completely different, I guess it's confusing at the moment that they are similar but not the same. Which do you think would be better?

polymeris commented 3 years ago

Something like this? Anyways, not a big deal. Feel free to close if you feel it doesn't add much value.

polymeris commented 3 years ago

(and please squash if you decide to merge)

oliyh commented 3 years ago

Thank you!