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: handle SDL & high throughput schema changes

See original GitHub issue

(carrying over this discussion with @acao from discord)

We’ve been using monaco-graphql to edit graphql schemas across multiple files, and it seems like the autocomplete (at least at the document level) is actually pretty operation-specific (e.g. suggesting query/mutation/subscription/fragment, as opposed to type/interface/enum/etc):

🖼 Screenshot of autocomplete suggestions image

One thing to note is that currently we’re updating the mode schema on each change (debounced), but the SDL passed to the monaco-graphql API could be invalid — this causes some trouble as the graphql autocomplete suggestions come and go as the schema is or isn’t valid. I know the worker should get destroyed and re-created on each schema change, but our setup (and our schema being very large) seems to cause some crashing issues where there are still a number of worker threads hanging around:

🖼 Screenshot of sources tab image

Two major issues here:

  • inline SDL autocompletion features are not working anymore!!
  • High throughput changes to the graphql schema for monaco-graphql cause issues with workers

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
cshavercommented, Feb 23, 2022

Notes from pairing with @acao today! 🎉

we looked at:

  • confirmed on the latest vite example, too many workers is triggered by schema changes
  • look at how schema is shared with the worker, since this can change often
    • e.g. innoDB, cache api

found some bugs:

  • (monaco-editor) bg missing on autocomplete box - need to create a bug ticket for them!
  • repro’d https://github.com/graphql/graphiql/pull/2171/files
  • monaco-react webpack example has some bugs that vite doesn’t
    • would be cool to get a basic cypress test (get model markers from monaco), visual diff testing
  • (monaco?) lots of logs from monarchCommon on parsing directives
  • improve webpack example config, so the web workers output name aren’t hashed
  • devx of running examples from root maybe: yarn run example:<example name>
Read more comments on GitHub >

github_iconTop Results From Across the Web

GraphiQL 2.0 Roadmap: What's in progress, What's Next ...
monaco -graphql - almost all required features are supported. ... we need for plugins and high throughput events ( onOperationChange , etc) ...
Read more >
Reusable GraphQL schema directives
That's why SDL provides a special syntax for annotating your types, fields, and arguments with directives that your schema-processing tools can ...
Read more >
Package monaco-graphql
Configurable multi-model, multi-schema language worker with fileMatch expressions · Code completion (schema driven) for Operation and SDL types · Hover (schema ...
Read more >
Is GraphQL the new REST in API design? | Enable Architect
GraphQL simplifies how data is accessed and handled. With REST APIs, data is typically gathered from several different endpoints. This process ...
Read more >
Using GraphQL and Ballerina with Multiple Data Sources - InfoQ
GraphQL was developed to handle the need for more flexible and ... written down in a schema using GraphQL schema definition language (SDL)....
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