graphql-docs
graphql-docs copied to clipboard
Isomorphic apps
trafficstars
Hi there,
Thanks for the nice module. I've promoted it on SO
Any thoughts on how to make it easier to use it in an isomorphic app context? On the server side I get:
***/node_modules/graphql-docs/dist/webpack:/~/style-loader/addStyles.js:31
if (typeof options.singleton === "undefined") options.singleton = isOldIE();
^
ReferenceError: window is not defined
Maybe related to #4 ?
Cheers,
Jun
FYI I've worked around this problem in the following way:
if (typeof window != "undefined") {
const GraphQLDocs = require('graphql-docs').GraphQLDocs;
return <GraphQLDocs fetcher={fetcher} />
} else {
return <div></div>
}