How to create schema from GraphQL File for GraphiQL? #1921
-
In production, we disable introspection. But I'd still like to get auto-complete inside of GraphiQL. As expected, server has access to the For context, we're serving GraphiQL as a single HTML file. Like this: ReactDOM.render(
React.createElement(GraphiQL, { fetcher: fetcher}),
document.getElementById('graphiql'),
); |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
You can give the schema as a prop (then no introspection will be done). |
Beta Was this translation helpful? Give feedback.
You can give the schema as a prop (then no introspection will be done).
According to the docs the expected type is
GraphQLSchema
, so you might need to first convert theschema.graphql
text file, for example usingbuildschema
from thegraphql
js package https://graphql.org/graphql-js/utilities/#buildschema.