File tree Expand file tree Collapse file tree 1 file changed +43
-0
lines changed Expand file tree Collapse file tree 1 file changed +43
-0
lines changed Original file line number Diff line number Diff line change 1+ import { storiesOf } from '@storybook/react'
2+ import { action } from '@storybook/addon-actions'
3+ import React from 'react'
4+ import { css , jsx } from '@emotion/core'
5+ import SelectWorkspace from '../src/containers/Check/SelectWorkspace'
6+ import SideBarDecorator from './utils/SideBarDecorator'
7+
8+ import TUTORIALS_QUERY from '../src/services/apollo/queries/tutorials'
9+ import { useQuery } from '@apollo/react-hooks'
10+ import ApolloClient from 'apollo-boost'
11+ import { ApolloProvider } from '@apollo/react-hooks'
12+
13+ const styles = {
14+ container : {
15+ display : 'flex' as 'flex' ,
16+ flexDirection : 'column' as 'column' ,
17+ } ,
18+ }
19+
20+ const client = new ApolloClient ( {
21+ uri : 'https://33mf420q4m.execute-api.us-west-2.amazonaws.com/stage/api-stage' ,
22+ } )
23+
24+ const Inner = ( ) => {
25+ const { loading, error, data } = useQuery ( TUTORIALS_QUERY )
26+ console . log ( error )
27+ return (
28+ < div >
29+ < div > Error: { JSON . stringify ( error ) } </ div >
30+ < div > Data: { JSON . stringify ( data ) } </ div >
31+ </ div >
32+ )
33+ }
34+
35+ storiesOf ( 'API' , module )
36+ . addDecorator ( SideBarDecorator )
37+ . add ( 'Request' , ( ) => {
38+ return (
39+ < ApolloProvider client = { client } >
40+ < Inner />
41+ </ ApolloProvider >
42+ )
43+ } )
You can’t perform that action at this time.
0 commit comments