Why do I need to convert my GraphQL query into a one-line string?
When sending GraphQL requests through web-based clients or tools, thequery field must be a valid JSON string. That means the entire GraphQL query must be on one line, and all double quotes " inside the query need to be escaped (e.g., \"). This ensures the JSON remains valid and can be parsed correctly.
How can I easily convert my multi-line playground query into the one-line web format?
The simplest method is using jsonblob.com:- Go to jsonblob.com
- Click CLEAR to reset the view
-
In the left panel, paste query:
-
In the right panel, scroll until you see the
Valuefield

- Paste your full GraphQL playground query into the
Valuefield. - The left panel automatically updates with the properly escaped one-line string.

What does the conversion actually do?
It turns this:\n.
