Skip to content

GraphQL queries with $ variables break plugin functionality in non-JS contexts #746

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
eezy0 opened this issue May 16, 2025 · 1 comment

Comments

@eezy0
Copy link

eezy0 commented May 16, 2025

Issue Description

While js-graphql-intellij-plugin was originally designed for JavaScript/TypeScript, it's also used as a foundation for other GraphQL plugins like the DGS IntelliJ Plugin (which supports Java/Kotlin). We've identified an issue where the plugin's functionality breaks when handling GraphQL queries containing $ variables within Kotlin string literals.

Related DGS Plugin Issue

I've also reported this issue in the DGS IntelliJ Plugin repository since it's directly affected:
Netflix/dgs-intellij-plugin#114

Current Behavior

When writing GraphQL queries in Kotlin string literals that include variable declarations (e.g., ${'$'}filter: FilterInput!), the plugin fails to:

  • Provide proper syntax highlighting
  • Offer code completion
  • Validate against schema

This appears to be a core functionality issue in the base plugin that affects derived implementations like the DGS plugin.

Example

val query = """
    query GetItems(${'$'}filter: FilterInput!) {
        items(filter: ${'$'}filter) {
            id
            name
        }
    }
""".trimIndent()

Expected Behavior

The plugin should properly parse and process GraphQL queries containing variable declarations in non-JavaScript contexts (particularly in Kotlin string literals), maintaining all functionality regardless of the presence of $ symbols.

Since this plugin serves as a foundation for other language-specific GraphQL plugins (like the DGS plugin for Java/Kotlin), resolving this issue at the core level would benefit the broader GraphQL plugin ecosystem in IntelliJ-based IDEs.

@vepanimas
Copy link
Collaborator

Hi @eezy0! This should be already fixed in WEB-68137, and it will be available with 2025.2 IDEs update.

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

No branches or pull requests

2 participants