Import Postman GraphQL requests as a native GraphQL block (fixes voiden#490)#1
Open
rajkumar0932 wants to merge 1 commit into
Open
Import Postman GraphQL requests as a native GraphQL block (fixes voiden#490)#1rajkumar0932 wants to merge 1 commit into
rajkumar0932 wants to merge 1 commit into
Conversation
A GraphQL request was converted into a plain POST request block (method + URL) plus a detached query block, leaving the endpoint stranded in its own POST block. Emit a native gqlquery block instead, with the endpoint folded in as gqlurl and the query as gqlbody (the current format), plus a gqlvariables block when variables are present. Non-GraphQL requests are unchanged. Fixes VoidenHQ/voiden#490 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Author
|
Saw voiden#490 shipped in 2.2.0 via the converter fix in 424b904 (nice touches with the uid attrs and CRLF normalization) — glad the gqlquery/gqlurl approach made it in. Happy to close this since it's covered now, or rebase on v1.0.6 if any part is still useful. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
GraphQL requests imported from a Postman collection were converted into a plain
POSTrequest block (method + URL) plus a detached query block — so the endpoint got stranded in its own POST block at the top of the file instead of inside the GraphQL block.This emits a native
gqlqueryblock instead, with:gqlurlchild,gqlbodychild (current format:body+operationType+schema*attrs),gqlvariablesblock when variables are present.Non-GraphQL requests are unchanged.
Fixes VoidenHQ/voiden#490
Before / After
For a Postman GraphQL request, the importer previously produced:
Now it produces:
This matches the shape the app already expects: its old→new
gqlquerymigration converts togqlurl+gqlbody, and GraphQL requests are detected viafindNode("gqlquery").Testing
node build.mjsbuilds cleanly (vite/esbuild).gqlqueryblock containing thegqlurlendpoint andgqlbody, followed by agqlvariablesblock, with no strayrequest/POST block;operationTypeis detected (reuses the existingdetectGraphqlOperationTypehelper); REST requests still produce a normalrequestblock.The repo has no unit-test harness, so I validated the output against the app's canonical block format rather than adding a test suite — happy to add one if you'd like.