You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 14, 2023. It is now read-only.
I tried the first time to integrate WebSocketLink and it worked like a charm but as soon as I added WebSocketLink, the console keeps logging the same line every 1 minute. This is happening in a react-native project in a development build.
Expected Behavior
No logging.
Actual Behavior
The line being logged: SocketRocket: In debug mode. Allowing connection to any root cert
A simple reproduction
How to reproduce:
The problem is occurring in a react native project, So to reproduce
npx react-native init myApp
Install all required dependencies used in the following piece of code.
Create apolloInit.js.
import{ApolloClient}from'apollo-client'import{createHttpLink}from'apollo-link-http'import{InMemoryCache}from'apollo-cache-inmemory'import{setContext}from'apollo-link-context'import{split}from'apollo-link'import{WebSocketLink}from'apollo-link-ws'import{getMainDefinition}from'apollo-utilities'// Create an http link:consthttpLink=newHttpLink({uri: 'https://localhost:3000/graphql'});constauthLink=setContext((operation,{ headers })=>{// get the authentication token from storage if it existsconsttoken=awaitAsyncstorage.get('token')// return the headers to the context so httpLink can read themreturn{headers: {
...headers,authorization: token ? `Bearer ${token}` : '',},}})// Create a WebSocket link:consttoken=awaitAsyncstorage.get('token')constwsLink=newWebSocketLink({uri: `wss://localhost:5000/`,options: {reconnect: true,connectionParams: {authorization: token ? `Bearer ${token}` : ''}}});// using the ability to split links, you can send data to each link// depending on what kind of operation is being sentconstlink=split(// split based on operation type({ query })=>{constdefinition=getMainDefinition(query);return(definition.kind==='OperationDefinition'&&definition.operation==='subscription');},wsLink,authLink.concat(httpLink),);
I tried the first time to integrate
WebSocketLink
and it worked like a charm but as soon as I addedWebSocketLink
, the console keeps logging the same line every 1 minute. This is happening in areact-native
project in a development build.Expected Behavior
No logging.
Actual Behavior
The line being logged:
SocketRocket: In debug mode. Allowing connection to any root cert
A simple reproduction
How to reproduce:
The problem is occurring in a react native project, So to reproduce
npx react-native init myApp
apolloInit.js
.app.js
as follows:The text was updated successfully, but these errors were encountered: