Skip to content

Schema discovery broken because unsupport "%" char: during SchemaPrinter.printType inside inputObjectPrinter. #758

@YiGuoZhLong

Description

@YiGuoZhLong

Describe the bug

2025-11-27 15:37:27,249 [  89939]   WARN - #c.i.l.j.i.n.GraphQLNotificationUtil - Format specifier '% o'
java.util.MissingFormatArgumentException: Format specifier '% o'
	at java.base/java.util.Formatter.format(Formatter.java:2790)
	at java.base/java.io.PrintWriter.implFormat(PrintWriter.java:1203)
	at java.base/java.io.PrintWriter.format(PrintWriter.java:1191)
	at com.intellij.lang.jsgraphql.types.schema.idl.SchemaPrinter.lambda$inputObjectPrinter$6(SchemaPrinter.java:679)
	at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:184)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1596)
	at java.base/java.util.stream.SortedOps$RefSortingSink.end(SortedOps.java:395)
	at java.base/java.util.stream.Sink$ChainedReference.end(Sink.java:261)
	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:510)
	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
	at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151)
	at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174)
	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
	at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:596)
	at com.intellij.lang.jsgraphql.types.schema.idl.SchemaPrinter.lambda$inputObjectPrinter$7(SchemaPrinter.java:670)
	at com.intellij.lang.jsgraphql.types.schema.idl.SchemaPrinter.printType(SchemaPrinter.java:1025)
	at com.intellij.lang.jsgraphql.types.schema.idl.SchemaPrinter.lambda$printType$17(SchemaPrinter.java:1020)
	at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:184)
	at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:179)
	at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:179)
	at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1708)
	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
	at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151)
	at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174)
	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
	at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:596)
	at com.intellij.lang.jsgraphql.types.schema.idl.SchemaPrinter.printType(SchemaPrinter.java:1020)
	at com.intellij.lang.jsgraphql.types.schema.idl.SchemaPrinter.print(SchemaPrinter.java:392)
	at com.intellij.lang.jsgraphql.ide.introspection.GraphQLIntrospectionService.printIntrospectionAsGraphQL(GraphQLIntrospectionService.java:241)
	at com.intellij.lang.jsgraphql.ide.introspection.GraphQLIntrospectionService.parseIntrospectionOutput(GraphQLIntrospectionService.java:318)
	at com.intellij.lang.jsgraphql.ide.introspection.GraphQLIntrospectionQueryExecutor$runIntrospectionQuery$1$1.invokeSuspend$lambda$2(GraphQLIntrospectionQueryExecutor.kt:66)
	at com.intellij.openapi.progress.CoroutinesKt.blockingContextInner(coroutines.kt:345)
	at com.intellij.openapi.progress.CoroutinesKt$blockingContext$2.invokeSuspend(coroutines.kt:237)
	at com.intellij.openapi.progress.CoroutinesKt$blockingContext$2.invoke(coroutines.kt)
	at com.intellij.openapi.progress.CoroutinesKt$blockingContext$2.invoke(coroutines.kt)
	at kotlinx.coroutines.intrinsics.UndispatchedKt.startUndispatchedOrReturn(Undispatched.kt:62)
	at kotlinx.coroutines.CoroutineScopeKt.coroutineScope(CoroutineScope.kt:261)
	at com.intellij.openapi.progress.CoroutinesKt.blockingContext(coroutines.kt:236)
	at com.intellij.lang.jsgraphql.ide.introspection.GraphQLIntrospectionQueryExecutor$runIntrospectionQuery$1$1.invokeSuspend(GraphQLIntrospectionQueryExecutor.kt:65)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:104)
	at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:608)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:873)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:763)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:750)

To Reproduce
Use this config:

schema: _schema.graphql
documents: '**/*.graphql'
extensions:
  endpoints:
    shopify_v2025-04:
      url: https://shopify.dev/admin-graphql-direct-proxy/2025-04

Version and Environment Details
Operation system: Windows 10 x64
IDE name and version:

PyCharm 2025.1.2
Build #PY-251.26094.141, built on June 10, 2025
Source revision: 0f4e379ff77b9
Runtime version: 21.0.7+9-b895.130 amd64 (JCEF 122.1.9)
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Toolkit: sun.awt.windows.WToolkit
Windows 10.0
GC: G1 Young Generation, G1 Concurrent GC, G1 Old Generation
Memory: 12000M
Cores: 12
Registry:
  ide.experimental.ui=true
Non-Bundled Plugins:
  com.intellij.lang.liquid (251.23774.318)
  String Manipulation (9.15.0)
  indent-rainbow.indent-rainbow (2.2.0)
  GrepConsole (13.2.0-IJ2023.3)
  nl.jusx.pycharm.lineprofiler (1.10.0)
  com.insyncwithfoo.pyright (0.11.0)
  mobi.hsz.idea.gitignore (4.5.6)
  izhangzhihao.rainbow.brackets.lite (1.2.0)
  com.intellij.lang.jsgraphql (251.26094.37)
  de.endrullis.idea.postfixtemplates (2.22.0.242)
  com.intellij.plugins.html.instantEditing (251.23774.318)

Plugin version: 251.26094.37

Additional context

Answer from LLM:

This is a bug in the IntelliJ IDEA GraphQL Plugin.

The Cause

The error java.util.MissingFormatArgumentException: Format specifier '% o' indicates that the plugin is trying to print text from your GraphQL schema (likely a description or comment) using a Java formatting function (like printf), but it is incorrectly treating the content of your schema as code instructions.

Specifically, the plugin encountered a piece of text in your GraphQL schema—likely within an Input Object—that contains a percent sign followed by a space and the letter 'o' (e.g., "... % of ..." or "... % o...").

Java interprets % o as a command to "format an octal integer with a leading space," but since no number was provided, the plugin crashes.

How to Fix It

1. Update the Plugin

Check if there is an update available for the GraphQL plugin in IntelliJ.

  • Go to Settings/Preferences -> Plugins.
  • Search for "GraphQL".
  • If an update is available, install it and restart the IDE. This issue may have been patched in a newer version.

2. Workaround: sanitize Your Schema (If you control it)

If you cannot update the plugin or the update doesn't fix it, you need to find the text causing the crash in your GraphQL Schema.

  1. Look at your Input Objects (types used as arguments in mutations/queries).
  2. Search your schema (or the backend code generating the schema) for the % symbol.
  3. Look specifically for descriptions that might say things like "Represents the % of..." or similar.
  4. Remove or reword that description (e.g., change % to percent).
  5. Re-run the introspection.

3. Report the Issue

If you are on the latest version, this is a valid bug that should be reported to the plugin maintainers.

  • Repository: JetBrains/js-graphql-intellij-plugin
  • Create a new issue and paste the stack trace you provided. Mention that it crashes during SchemaPrinter.printType inside inputObjectPrinter.

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