【问题标题】:initPayload from SocketClientConfig is not accepting Json-like data来自 SocketClientConfig 的 initPayload 不接受类似 Json 的数据
【发布时间】:2021-04-06 05:42:05
【问题描述】:

描述错误

我收到以下错误消息

The argument type 'Map<String, Map<String,String>>' can't be assigned to the parameter type 'Future<dynamic> Function()'.

对于initPayload参数在此代码:

static final WebSocketLink webSocketLink = WebSocketLink(
    url: 'wss://hasura.io/learn/graphql',
    config: SocketClientConfig(
      autoReconnect: true,
      inactivityTimeout: Duration(seconds: 30),
      initPayload: {'headers': {'Authorization': _token}},
    ),
  );

复制

【问题讨论】:

  • 这可能与node.js的版本有关吗?你用什么版本?你试过改变它吗?

标签: flutter websocket graphql hasura


【解决方案1】:

可以在this post找到答案。

【讨论】:

    猜你喜欢
    • 2018-09-27
    • 2018-11-08
    • 2015-09-07
    • 1970-01-01
    • 2013-03-09
    • 2016-02-11
    • 1970-01-01
    • 2018-09-25
    • 1970-01-01
    相关资源
    最近更新 更多