The subscribe function: authorize FIRST (asynchronously), then open the stream. Exported (with an
injectable deps argument graphql-js never passes) so the whole path is testable end to end.
graphql-js awaits the value subscribe returns and turns a thrown error into a per-operation error
result, which is exactly what a refusal should be (a failure of this subscription, not the socket).
The
subscribefunction: authorize FIRST (asynchronously), then open the stream. Exported (with an injectabledepsargument graphql-js never passes) so the whole path is testable end to end.graphql-js awaits the value
subscribereturns and turns a thrown error into a per-operation error result, which is exactly what a refusal should be (a failure of this subscription, not the socket).