Describe the bug
Fragments are not recognised inside strings with injected GraphQL language in some cases.
To Reproduce
Using the following text block in TS file
`
query {
me {
...AuthFragment
}
}
fragment AuthFragment on User {
email
}
`;
and then from context actions selecting "Inject language" -> GraphQL.
Everything should be valid, but ...AuthFragment is highlighted with Unknown fragment spread "AuthFragment".
Adding explicit
// language=GraphQL
to the top fixes the issue.
// language=GraphQL
`
query {
me {
...AuthFragment
}
}
fragment AuthFragment on User {
email
}
`;
The same thing happens in Java files, but there adding language=GraphQL or org.intellij.lang.annotations.Language("GraphQL") annotation doesn't fix the issue.
Expected behavior
Valid GraphQL queries should not be marked with errors
Version and Environment Details
IDE name and version: IntelliJ IDEA 2023.1.2 (Ultimate Edition)
Plugin version: 4.0.1
Describe the bug Fragments are not recognised inside strings with injected GraphQL language in some cases.
To Reproduce Using the following text block in TS file
and then from context actions selecting "Inject language" -> GraphQL.
Everything should be valid, but
...AuthFragment
is highlighted withUnknown fragment spread "AuthFragment"
.Adding explicit
to the top fixes the issue.
The same thing happens in Java files, but there adding
language=GraphQL
ororg.intellij.lang.annotations.Language("GraphQL")
annotation doesn't fix the issue.Expected behavior Valid GraphQL queries should not be marked with errors
Version and Environment Details IDE name and version: IntelliJ IDEA 2023.1.2 (Ultimate Edition) Plugin version: 4.0.1