mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-06 15:31:16 +08:00
17 lines
395 B
TypeScript
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,
|
|
});
|
|
});
|
|
}
|