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,
);
}
}
字符串
我得到了以下异常
DOMException: Failed to execute 'close' on 'WebSocket': The code must be either 1000, or between 3000 and 4999. 1001 is neither.
型
1条答案
按热度按时间h79rfbju1#
必须调用
字符串
和
型