Describe the bug
I'm getting the following error message
The argument type 'Map<String, Map<String,String>>' can't be assigned to the parameter type 'Future<dynamic> Function()'.
for initPayload
parameter at this code:
static final WebSocketLink webSocketLink = WebSocketLink(
url: 'wss://hasura.io/learn/graphql',
config: SocketClientConfig(
autoReconnect: true,
inactivityTimeout: Duration(seconds: 30),
initPayload: {'headers': {'Authorization': _token}},
),
);
To Reproduce
- Following the GraphQL Flutter Tutorial.
- According to initPayload property help:
Can be null, but must be a valid json structure if provided.
- According to GetInitPayload typedef help:
typedef GetInitPayload = FutureOr<dynamic> Function();