storybook/docs/snippets/react/component-story-with-query.js.mdx
2020-10-07 12:23:34 +08:00

25 lines
472 B
Plaintext

```js
// my-component-with-query.stories.js
import MyComponentThatHasAQuery, { MyQuery} from '../component-that-has-a-query';
const Template = (args) => <MyComponentThatHasAQuery {...args}/>;
export const LoggedOut = Template.bind({});
LoggedOut.parameters = {
apolloClient: {
mocks: [
{
request: {
query: MyQuery,
},
result: {
data: {
viewer: null
},
},
},
],
},
};
```