
Research
Security News
Lazarus Strikes npm Again with New Wave of Malicious Packages
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
storybook-addon-apollo-client
Advanced tools
Use Apollo Client in your Storybook stories.
yarn
yarn add --dev storybook-addon-apollo-client
npm
npm install -D storybook-addon-apollo-client
import { withApolloClient } from 'storybook-addon-apollo-client';
import MyComponentThatHasAQuery, {
MyQuery,
} from '../component-that-has-a-query';
export default {
title: 'My Story',
decorators: [withApolloClient],
};
export const example = () => <MyComponentThatHasAQuery />;
example.story = {
parameters: {
apolloClient: {
mocks: [
{ request: { query: MyQuery }, result: { data: { viewer: null } } },
],
},
},
};
preview.js
import { withApolloClient } from 'storybook-addon-apollo-client';
import { addDecorator } from '@storybook/react';
import { InMemoryCache } from 'apollo-cache-inmemory';
const cache = new InMemoryCache();
addDecorator(
withApolloClient({
cache,
...// take a look at all the options in https://www.apollographql.com/docs/react/development-testing/testing
// everything that is used in `storybook-addon-apollo-client` is a 1 to 1 mapping of MockedProvider
})
);
if you setup withApolloClient
in preview, it will not need to be added to the decorators
key in each story, consider doing this if you have a lot of stories that depend on Apollo.
Read more about the options available for MockedProvider at https://www.apollographql.com/docs/react/development-testing/testing
To see real world usage of how to use this addon, check out the example app:
FAQs
Use Apollo Client in your Storybook stories.
The npm package storybook-addon-apollo-client receives a total of 53,432 weekly downloads. As such, storybook-addon-apollo-client popularity was classified as popular.
We found that storybook-addon-apollo-client demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
Security News
Socket CEO Feross Aboukhadijeh discusses the open web, open source security, and how Socket tackles software supply chain attacks on The Pair Program podcast.
Security News
Opengrep continues building momentum with the alpha release of its Playground tool, demonstrating the project's rapid evolution just two months after its initial launch.