monaco-graphql: work with multiple instances?
See original GitHub issueLooking at the monaco-graphql API I was wondering if it’s possible to use it for individual instances? Let’s have a look at this example:
import { api as GraphQLAPI } from 'monaco-graphql';
GraphQLAPI.setSchema(`
type Query {
foo: String
}
`);
Assuming I have two instances of monaco editor running, how can I set a different schema or settings in general for individual instances?
Issue Analytics
- State:
- Created 3 years ago
- Comments:14 (11 by maintainers)
Top Results From Across the Web
monaco-graphql: workers not cleaned up -> memory leak #1706
One editor.worker.js and two instances of graphql.worker.js, which seems to be fine. On first unmount, the editor.worker.js disappears while the ...
Read more >Package monaco-graphql
GraphQL language plugin for the Monaco Editor. You can use it to build vscode/codespaces-like web or desktop IDEs using whatever frontend javascript libraries ......
Read more >Monaco-graphql - npm.io
GraphQL language plugin for the Monaco Editor. You can use it to build vscode/codespaces-like web or desktop IDEs using whatever frontend javascript libraries ......
Read more >monaco-graphql - npm
full service, official monaco mode for GraphQL. Latest version: 1.1.6, last published: a month ago. Start using monaco-graphql in your ...
Read more >Monaco Editor
Game of Life * Implemented in TypeScript * To learn more about TypeScript, please visit ... This library is supported for use in...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
It makes total sense to me! I think, the user should fetch the schema the way they want and provide it as a static string. Makes the lifecycle of the worker a lot easier.
Okay, I have tried to set
.setSchema()
,.setSchemaUrl()
and.setSchemaConfig({url: ""})
. The auto-completion feature is not working fine with any of these APIs for multiple schemas. also when the schema is not set then auto-completion shows random values based on previous texts of the edito.I’ll again try with a dedicated example to make sure where the issue is.