Skip to content

Nitro Client fails to parse when graphql variables are part of arrays [$someValue] #8301

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
icanhasjonas opened this issue May 21, 2025 · 1 comment
Assignees

Comments

@icanhasjonas
Copy link
Contributor

icanhasjonas commented May 21, 2025

Product

Nitro

Version

28.0.7

Link to minimal reproduction

https://gist.github.com/icanhasjonas/e6455e0d80e41059f2d918dfa514762d

Steps to reproduce

When referencing a variable in an array, the nitro parse seams to break, and making the whole document invalid.

Parser working (shows Run > etc)

mutation SomeMutation($someValue: String!) {
  hello( a: ["some value"]) { a, b, c}
}

Not working

mutation SomeMutation($someValue: String!) {
  hello( a: [$someValue]) { a, b, c}
}

What is expected?

The document should be parsable and the individually named actions in the editor should be recognized

What is actually happening?

As soon as you type $ in an array [$someVariable], all named queries, mutations etc are not recognized.

Relevant log output

chrome console log


main.66754811.js:2 Uncaught (in promise) Error: Ancestor for kind "ListValue" not found!
    at d (main.66754811.js:2:735954)
    at T (main.66754811.js:2:725432)
    at d (main.66754811.js:2:718244)
    at gc.updateAST (main.66754811.js:2:265395)
    at 649.ddb22630.chunk.js:1:687272
    at 649.ddb22630.chunk.js:1:687555
    at j.value (104.66754811.js:2:856086)
    at K._deliver (104.66754811.js:2:300181)
    at K._deliverQueue (104.66754811.js:2:300287)
    at K.fire (104.66754811.js:2:300717)

Additional context

No response

@rstaib rstaib self-assigned this May 22, 2025
@rstaib
Copy link
Member

rstaib commented May 22, 2025

@icanhasjonas I will take a look at this shortly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants