question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

monaco-graphql: work with multiple instances?

See original GitHub issue

Looking 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:closed
  • Created 3 years ago
  • Comments:14 (11 by maintainers)

github_iconTop GitHub Comments

1reaction
jensneusecommented, Nov 16, 2021

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.

1reaction
Nishchit14commented, Sep 23, 2021

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found