class GraphqlConfig {
final serverLink = Link.split(
(request) => request.isSubscription,
WebSocketLink(
"mylink"
),
HttpLink("mylink",
defaultHeaders: <String, String>{
}));
initClient() {
ValueNotifier<GraphQLClient> client = ValueNotifier(
GraphQLClient(
link: serverLink,
cache: GraphQLCache(),
),
);
return client;
}
GraphQLClient clientToQuery() {
return GraphQLClient(
cache: GraphQLCache(),
link: serverLink,
);
}
}
I got the following exception
DOMException: Failed to execute 'close' on 'WebSocket': The code must be either 1000, or between 3000 and 4999. 1001 is neither.