[PR #499] [MERGED] Convert request bodies when changing type #3348

Closed
opened 2026-07-15 02:02:55 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/mountain-loop/yaak/pull/499
Author: @gschier
Created: 7/5/2026
Status: Merged
Merged: 7/5/2026
Merged by: @gschier

Base: mainHead: codex/convert-request-bodies


📝 Commits (3)

  • 43bb969 Convert request bodies when changing type
  • 428962d Support GraphQL operation selection
  • 97c4023 Address GraphQL conversion review notes

📊 Changes

13 files changed (+1063 additions, -149 deletions)

View changed files

📝 apps/yaak-client/components/HttpRequestPane.tsx (+9 -1)
📝 apps/yaak-client/components/graphql/GraphQLEditor.tsx (+213 -123)
apps/yaak-client/lib/graphqlOperationNames.test.ts (+37 -0)
apps/yaak-client/lib/graphqlOperationNames.ts (+26 -0)
apps/yaak-client/lib/requestBodyConversion.test.ts (+152 -0)
apps/yaak-client/lib/requestBodyConversion.ts (+199 -0)
📝 crates/yaak-http/src/types.rs (+77 -14)
📝 plugins/action-copy-curl/src/index.ts (+1 -0)
📝 plugins/action-copy-curl/tests/index.test.ts (+19 -0)
plugins/importer-curl/src/graphql.ts (+117 -0)
📝 plugins/importer-curl/src/index.ts (+20 -11)
plugins/importer-curl/tests/graphql.test.ts (+146 -0)
📝 plugins/importer-curl/tests/index.test.ts (+47 -0)

📄 Description

Fixes Graphql incorrect request after import from Curl. This updates request body-type changes to convert compatible body shapes, detects strict GraphQL JSON bodies during cURL import, and imports them into Yaak’s GraphQL body shape.

  • Convert request bodies when switching between compatible body types, including URL-encoded form bodies to text.
  • Detect GraphQL JSON cURL imports with a focused heuristic and parse them into GraphQL request bodies.
  • Preserve GraphQL operationName through conversion and send serialization.
  • Validated with client lint, request body conversion tests, cURL importer tests, and focused GraphQL body serialization tests.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/mountain-loop/yaak/pull/499 **Author:** [@gschier](https://github.com/gschier) **Created:** 7/5/2026 **Status:** ✅ Merged **Merged:** 7/5/2026 **Merged by:** [@gschier](https://github.com/gschier) **Base:** `main` ← **Head:** `codex/convert-request-bodies` --- ### 📝 Commits (3) - [`43bb969`](https://github.com/mountain-loop/yaak/commit/43bb9698fc585ddc56dbd9fc1d5e4a5a1298dc2c) Convert request bodies when changing type - [`428962d`](https://github.com/mountain-loop/yaak/commit/428962d986e0b54cdf6a56e4e35256a9ad3b7f8a) Support GraphQL operation selection - [`97c4023`](https://github.com/mountain-loop/yaak/commit/97c4023fe82d2bae17c60dc30f36be196eaf2ed9) Address GraphQL conversion review notes ### 📊 Changes **13 files changed** (+1063 additions, -149 deletions) <details> <summary>View changed files</summary> 📝 `apps/yaak-client/components/HttpRequestPane.tsx` (+9 -1) 📝 `apps/yaak-client/components/graphql/GraphQLEditor.tsx` (+213 -123) ➕ `apps/yaak-client/lib/graphqlOperationNames.test.ts` (+37 -0) ➕ `apps/yaak-client/lib/graphqlOperationNames.ts` (+26 -0) ➕ `apps/yaak-client/lib/requestBodyConversion.test.ts` (+152 -0) ➕ `apps/yaak-client/lib/requestBodyConversion.ts` (+199 -0) 📝 `crates/yaak-http/src/types.rs` (+77 -14) 📝 `plugins/action-copy-curl/src/index.ts` (+1 -0) 📝 `plugins/action-copy-curl/tests/index.test.ts` (+19 -0) ➕ `plugins/importer-curl/src/graphql.ts` (+117 -0) 📝 `plugins/importer-curl/src/index.ts` (+20 -11) ➕ `plugins/importer-curl/tests/graphql.test.ts` (+146 -0) 📝 `plugins/importer-curl/tests/index.test.ts` (+47 -0) </details> ### 📄 Description Fixes [Graphql incorrect request after import from Curl](https://yaak.app/feedback/posts/graphql-empty-request-after-import-from-curl). This updates request body-type changes to convert compatible body shapes, detects strict GraphQL JSON bodies during cURL import, and imports them into Yaak’s GraphQL body shape. - Convert request bodies when switching between compatible body types, including URL-encoded form bodies to text. - Detect GraphQL JSON cURL imports with a focused heuristic and parse them into GraphQL request bodies. - Preserve GraphQL `operationName` through conversion and send serialization. - Validated with client lint, request body conversion tests, cURL importer tests, and focused GraphQL body serialization tests. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-07-15 02:02:55 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/yaak#3348