Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
}),
new HttpLink({
uri: graphqlUri,
})
]);
const link = split(
({query}) => {
const {kind, operation} = getMainDefinition(query);
return kind === 'OperationDefinition' && operation === 'subscription';
},
wsLink,
httpLink,
);
const client = new ApolloClient({
link,
cache: new InMemoryCache()
});
// adding fontawesome icons we'll use
library.add(faMapMarker);
library.add(faMapPin);
library.add(faMapMarkerAlt);
class App extends Component {
render() {
return (
export default function newClient(opts) {
// eslint-disable-next-line new-cap
const link = new ApolloLink.split(
operation => hasSubscription(operation.query),
absintheSocketLink(opts),
createHttpLink({uri: '/api/graphql'})
);
const client = new ApolloClient({
link,
cache: new InMemoryCache()
});
return client;
}
types: [
{
'kind': 'INTERFACE',
'name': 'User',
'possibleTypes': [
{'name': 'Player'},
{'name': 'Viewer'}
]
},
],
},
}
});
this._apolloClient = new ApolloClient({
networkInterface: this._subscriptionClient,
fragmentMatcher: fragmentMatcher,
});
});
}