Skip to content

JSON validation does not work with GraphiQL #720

@dorshinar

Description

@dorshinar

Hi :)

Following up on the issue raised here. I got GraphiQL working with monaco-vscode-api, but for some reason the variables panel is not being validated against the schema.

I was able to find out that monaco.languages.json.jsonDefaults.diagnosticsOptions is updating correctly, and is correlated with the query, so the graphql worker is working as expected, but no markers are shown in the variables panel. I also tested dummy schemas that should fail everything to no avail.

The demo from this repo does seem to validate json files (at least the jsconfig.json that comes with it), so I'm probably missing something in my config.

Here's a demo project where this happens. It relies on changes from this PR. Once they are released I'll update the packages.

You can try this query:

query MyQuery ($limit: Int) {
  ability(limit: $limit) {
    generaton_id
  }
}

With this variables json:

{
    "limdit": 1
}

The generaton_id is a misspelling of generation_id, and we can see the error:
CleanShot 2025-10-20 at 11 02 42

But limidt is also a misspelling of limit, but no squiggly line:
CleanShot 2025-10-20 at 11 03 10

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions