Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
bootstrapClient() {
if (this.client) {
return;
}
const { links, resolvers, typeDefs } = this.settings;
this.client = new ApolloClient({
cache: new InMemoryCache(),
connectToDevTools: __DEV__,
link: ApolloLink.from(links),
name: Core.settings.name,
resolvers,
typeDefs,
version: pkg.version,
});
if (__DEV__) {
// eslint-disable-next-line no-underscore-dangle
window.__APOLLO_CLIENT__ = this.client;
}
}
export type State = {
breadcrumbs: Breadcrumb[];
data: { [id: string]: object };
toasts: Toast[];
};
export { AppContext };
export class AppShell extends React.Component {
static propTypes = {
name: componentName.isRequired,
};
static defaultProps = {
name: Core.settings.name,
};
state = {
breadcrumbs: [],
data: {},
toasts: [],
};
addBreadcrumb = (label: string, props: Breadcrumb['props'] = {}) => {
const id = uuid();
this.setState(prevState => ({
breadcrumbs: [
...prevState.breadcrumbs,
{
id,