Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
case 'songs':
return 'Song';
case 'playlistSongs':
return 'PlaylistSong';
case 'historySongs':
return 'HistorySong';
default:
throw new Error(`Unknown resource ${resource}`);
}
};
return buildApolloClient({
clientOptions: {
link: authLink.concat(httpLink),
cache: new InMemoryCache()
}
})
.then((dataProvider: any) => (type: any, resource: string, params: any) =>
dataProvider(type, getGqlResource(resource), params)
)
.catch(() => {
localStorage.clear();
window.location.reload();
});
};