UNPKG

@graphiql/react

Version:

[Changelog](https://github.com/graphql/graphiql/blob/main/packages/graphiql-react/CHANGELOG.md) | [API Docs](https://graphiql-test.netlify.app/typedoc/modules/graphiql_react.html) | [NPM](https://www.npmjs.com/package/@graphiql/react)

19 lines (17 loc) 703 B
/* eslint-disable import-x/no-unresolved */ import JsonWorker from 'https://esm.sh/monaco-editor@0.52.2/esm/vs/language/json/json.worker.js?worker'; import GraphQLWorker from 'https://esm.sh/monaco-graphql/esm/graphql.worker.js?worker&deps=monaco-editor@0.52.2'; import EditorWorker from 'https://esm.sh/monaco-editor@0.52.2/esm/vs/editor/editor.worker.js?worker'; globalThis.MonacoEnvironment = { getWorker(_workerId, label) { // eslint-disable-next-line no-console console.info('setup-workers/esm.sh', { label }); switch (label) { case 'json': return new JsonWorker(); case 'graphql': return new GraphQLWorker(); } return new EditorWorker(); }, };