Open vytautas-pranskunas- opened 1 year ago
can i work on this
I have the same problem on Android (API 34). It crashes even the whole emulator at app start. On web and even iOS, my code works fine.
E/flutter ( 4262): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: Null check operator used on a null value
E/flutter ( 4262): #0 SocketClient.onConnectionLost (package:graphql/src/links/websocket_link/websocket_client.dart:375:29)
E/flutter ( 4262): #1 SocketClient._connect (package:graphql/src/links/websocket_link/websocket_client.dart:369:7)
E/flutter ( 4262): <asynchronous suspension>
My client initialisation code looks like this:
final errorLink = ErrorLink(
onException: (request, forward, exception) {
logger.e(exception);
return null;
},
);
final WebSocketLink websocketLink = WebSocketLink(
websocketBackendUrl,
config: SocketClientConfig(
autoReconnect: true,
inactivityTimeout: const Duration(seconds: 30),
initialPayload: () async {
// ... some authentication logic
}),
subProtocol: GraphQLProtocol.graphqlTransportWs,
);
Link link = errorLink.concat(websocketLink);
return GraphQLClient(
link: link,
cache: GraphQLCache(store: InMemoryStore()),
defaultPolicies: DefaultPolicies(
query: Policies(fetch: FetchPolicy.noCache),
mutate: Policies(fetch: FetchPolicy.noCache),
),
);
The error occurres even when using version 5.2.0-beta.7
of the package (#1410).
my error logger reports follwoing error: