default code snippets for code exporter #3401
Unanswered
sahingoko
asked this question in
Q&A / Support
Replies: 1 comment
-
this example shows how to create your own snippets: https://github.com/graphql/graphiql/blob/main/examples/graphiql-webpack/src/snippets.js as you can see, you can generate snippets for any language and it will render them in the codemirror editor mode for that language there are no defaults. to set them as empty, you can set an empty array for snippets. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I am using the latest code exporter plugin inside a react app, hpwever could not find how I can use the default code snippets.
All the sample codes have the exampleSnippetOne and exampleSnippetTwo. I simply want to use whatever built-in snippet comes with the plugin itself.
Here is what the readme describes;
const snippets = [exampleSnippetOne, exampleSnippetTwo]
const exporter = codeExporterPlugin({
snippets,
codeMirrorTheme: 'graphiql',
});
There is no way to leave it empty or set the defaults.
Thanks.
Ozlem
Beta Was this translation helpful? Give feedback.
All reactions