onConnect abstract method

FutureOr<bool> onConnect(
  1. GraphQLWsClient client, [
  2. Map? connectionParams
])

Whether to accept the connection, given the client's connection_init payload.

Answer false, or throw, to refuse it; this is where authentication belongs. Either way the connection closes with GraphQLWsCloseCode.forbidden.

Implementation

FutureOr<bool> onConnect(GraphQLWsClient client, [Map? connectionParams]);