1
 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.
vincenzopalazzo
  • 1,487
  • 2
  • 7
  • 35
EA vijay
  • 136
  • 3
  • 11

0 Answers0