storybook/addons/graphql/src/register.ts
2019-05-26 20:48:09 +09:00

17 lines
395 B
TypeScript

import { addons, types } from '@storybook/addons';
import GQL from './manager';
import { ADDON_ID } from '.';
export function register() {
addons.register(ADDON_ID, () => {
addons.add(ADDON_ID, {
title: 'GraphiQL',
type: types.TAB,
route: ({ storyId }) => `/graphql/${storyId}`,
match: ({ viewMode }) => viewMode === 'graphql',
render: GQL,
});
});
}