mirror of
https://github.com/hoppscotch/hoppscotch.git
synced 2026-04-26 01:06:00 +03:00
[PR #5877] feat(gql): implement 'Import from cURL' for GraphQL requests #5387
Labels
No labels
CodeDay
a11y
browser limited
bug
bug fix
cli
core
critical
design
desktop
discussion
docker
documentation
duplicate
enterprise
feature
feature
fosshack
future
good first issue
hacktoberfest
help wanted
i18n
invalid
major
minor
need information
need testing
not applicable to hoppscotch
not reproducible
pull-request
question
refactor
resolved
sandbox
self-host
spam
stale
testmu
wip
wont fix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/hoppscotch#5387
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/hoppscotch/hoppscotch/pull/5877
Author: @nylyy0325
Created: 2/13/2026
Status: 🔄 Open
Base:
main← Head:main📝 Commits (10+)
de30d3afeat(gql): implement 'Import from cURL' for GraphQL requests3c3de31chore: remove local corepack shims001c09cchore: clean unintended PR artifactsa464734fix(gql): harden cURL import validation and UI behavior238e9cafix(gql): improve cURL import robustness and data handlinge6cfb3bfeat(gql): support headers and auth in cURL import5852a48fix(gql): sync variable format and implement header merging for cURL import6d40026refactor(gql): fix sticky header hardcoding and improve code consistencybfcd8cefix(gql): implement smart auth merge for cURL import to prevent data lossac91abbfix(gql): resolve lint warning and refine variable merge logic📊 Changes
6 files changed (+318 additions, -1 deletions)
View changed files
📝
.gitignore(+3 -0)📝
packages/hoppscotch-common/locales/cn.json(+2 -0)📝
packages/hoppscotch-common/locales/en.json(+2 -0)📝
packages/hoppscotch-common/src/components/graphql/RequestOptions.vue(+136 -1)➕
packages/hoppscotch-common/src/helpers/curl/gql_curl.spec.ts(+91 -0)📝
packages/hoppscotch-common/src/helpers/curl/index.ts(+84 -0)📄 Description
Title: feat(gql): support 'Import from cURL' for GraphQL requests
Summary:
This PR implements the cURL import feature for the GraphQL module.
Logic: Added parseCurlToGQL helper in hoppscotch-common to parse GraphQL JSON payloads.
UI: Added "Import from cURL" button in RequestOptions.vue.
Testing: Added gql_curl.spec.ts with 3 comprehensive test cases (All Passed).
Platforms: Verified on Windows/Web.
Closes:#1993, #4121
Bounty: Applying for the $50 bounty via Algora/Polar.
Summary by cubic
Adds “Import from cURL” for GraphQL so users can paste a cURL command to auto-fill endpoint, query, variables, headers, and auth. Tightens parsing and UI with strict detection, standardized error codes/i18n, safe defaults, smarter merging, consistent sticky header behavior, and ignores local Corepack shims.
New Features
Bug Fixes
Written for commit
a962916065. Summary will update on new commits.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.