[PR #5128] feat: added GraphQL support in REST tab #5066

Open
opened 2026-03-17 02:33:00 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/hoppscotch/hoppscotch/pull/5128
Author: @chhaviG22
Created: 6/4/2025
Status: 🔄 Open

Base: mainHead: feature/graphql-rest-integration


📝 Commits (2)

  • 578c3dd feat: added GraphQL support in REST tab
  • 60f30b8 Merge branch 'main' into feature/graphql-rest-integration

📊 Changes

24 files changed (+365 additions, -10 deletions)

View changed files

📝 packages/hoppscotch-common/src/components.d.ts (+1 -0)
📝 packages/hoppscotch-common/src/components/http/Body.vue (+14 -2)
packages/hoppscotch-common/src/components/http/BodyGraphQL.vue (+150 -0)
📝 packages/hoppscotch-common/src/components/http/Request.vue (+10 -1)
📝 packages/hoppscotch-common/src/components/http/RequestOptions.vue (+4 -1)
📝 packages/hoppscotch-common/src/helpers/RequestRunner.ts (+14 -1)
📝 packages/hoppscotch-common/src/helpers/__tests__/editorutils.spec.js (+1 -0)
📝 packages/hoppscotch-common/src/helpers/curl/__tests__/detectContentType.spec.js (+7 -0)
📝 packages/hoppscotch-common/src/helpers/editorutils.ts (+1 -0)
packages/hoppscotch-common/src/helpers/import-export/import/__tests__/importFromInsomnia.spec.ts (+37 -0)
packages/hoppscotch-common/src/helpers/import-export/import/__tests__/importFromPostman.spec.ts (+34 -0)
packages/hoppscotch-common/src/helpers/import-export/import/__tests__/mockInsomnia.json (+37 -0)
packages/hoppscotch-common/src/helpers/import-export/import/__tests__/mockPostman.json (+35 -0)
📝 packages/hoppscotch-common/src/helpers/import-export/import/insomniaEnv.ts (+1 -1)
📝 packages/hoppscotch-common/src/helpers/import-export/import/postman.ts (+1 -1)
📝 packages/hoppscotch-common/src/helpers/kernel/common/content.ts (+1 -0)
📝 packages/hoppscotch-common/src/helpers/utils/EffectiveURL.ts (+4 -1)
📝 packages/hoppscotch-common/src/helpers/utils/__tests__/contenttypes.spec.js (+1 -0)
📝 packages/hoppscotch-common/src/helpers/utils/contenttypes.ts (+7 -2)
📝 packages/hoppscotch-data/src/rest/content-types.ts (+1 -0)

...and 4 more files

📄 Description

Closes #2172
#2013
#2540
#4395

This PR introduces comprehensive GraphQL support within the REST tab. Enhancements include the addition of application/graphql as a body content-type, display and handling of query and variables fields for GraphQL, as well as support for editing, sending, and saving GraphQL requests. Furthermore, the PR integrates GraphQL request capabilities with Insomnia/Postman imports, supports predefined/environment variables. It also includes test cases to ensure functionality and stability.

What's changed

  • Added GraphQL content type to the body.
  • Integrated a GraphQL Body component that includes Query and Variable fields.
  • Handled support for cURL functionality.
  • Enabled the import of GraphQL requests in the REST tab from Insomnia and Postman.
  • Added support for environment variables and predefined variables.
  • Updated expressions to replace all environment variables for Insomnia imports.

Notes to reviewers

https://github.com/user-attachments/assets/5d28eab4-1fc2-4fde-b00a-f555eaf25c88


🔄 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/hoppscotch/hoppscotch/pull/5128 **Author:** [@chhaviG22](https://github.com/chhaviG22) **Created:** 6/4/2025 **Status:** 🔄 Open **Base:** `main` ← **Head:** `feature/graphql-rest-integration` --- ### 📝 Commits (2) - [`578c3dd`](https://github.com/hoppscotch/hoppscotch/commit/578c3dd7951f8888bb437a4d70baadca9f2b0164) feat: added GraphQL support in REST tab - [`60f30b8`](https://github.com/hoppscotch/hoppscotch/commit/60f30b8d6fdf55a030684cfc900bca3b8d992433) Merge branch 'main' into feature/graphql-rest-integration ### 📊 Changes **24 files changed** (+365 additions, -10 deletions) <details> <summary>View changed files</summary> 📝 `packages/hoppscotch-common/src/components.d.ts` (+1 -0) 📝 `packages/hoppscotch-common/src/components/http/Body.vue` (+14 -2) ➕ `packages/hoppscotch-common/src/components/http/BodyGraphQL.vue` (+150 -0) 📝 `packages/hoppscotch-common/src/components/http/Request.vue` (+10 -1) 📝 `packages/hoppscotch-common/src/components/http/RequestOptions.vue` (+4 -1) 📝 `packages/hoppscotch-common/src/helpers/RequestRunner.ts` (+14 -1) 📝 `packages/hoppscotch-common/src/helpers/__tests__/editorutils.spec.js` (+1 -0) 📝 `packages/hoppscotch-common/src/helpers/curl/__tests__/detectContentType.spec.js` (+7 -0) 📝 `packages/hoppscotch-common/src/helpers/editorutils.ts` (+1 -0) ➕ `packages/hoppscotch-common/src/helpers/import-export/import/__tests__/importFromInsomnia.spec.ts` (+37 -0) ➕ `packages/hoppscotch-common/src/helpers/import-export/import/__tests__/importFromPostman.spec.ts` (+34 -0) ➕ `packages/hoppscotch-common/src/helpers/import-export/import/__tests__/mockInsomnia.json` (+37 -0) ➕ `packages/hoppscotch-common/src/helpers/import-export/import/__tests__/mockPostman.json` (+35 -0) 📝 `packages/hoppscotch-common/src/helpers/import-export/import/insomniaEnv.ts` (+1 -1) 📝 `packages/hoppscotch-common/src/helpers/import-export/import/postman.ts` (+1 -1) 📝 `packages/hoppscotch-common/src/helpers/kernel/common/content.ts` (+1 -0) 📝 `packages/hoppscotch-common/src/helpers/utils/EffectiveURL.ts` (+4 -1) 📝 `packages/hoppscotch-common/src/helpers/utils/__tests__/contenttypes.spec.js` (+1 -0) 📝 `packages/hoppscotch-common/src/helpers/utils/contenttypes.ts` (+7 -2) 📝 `packages/hoppscotch-data/src/rest/content-types.ts` (+1 -0) _...and 4 more files_ </details> ### 📄 Description <!-- Thanks for creating this pull request 🤗 Please make sure that the pull request is limited to one type (docs, feature, etc.) and keep it as small as possible. You can open multiple prs instead of opening a huge one. --> <!-- If this pull request closes an issue, please mention the issue number below --> Closes #2172 #2013 #2540 #4395 <!-- Add an introduction into what this PR tries to solve in a couple of sentences --> This PR introduces comprehensive GraphQL support within the REST tab. Enhancements include the addition of `application/graphql` as a body content-type, display and handling of query and variables fields for GraphQL, as well as support for editing, sending, and saving GraphQL requests. Furthermore, the PR integrates GraphQL request capabilities with Insomnia/Postman imports, supports predefined/environment variables. It also includes test cases to ensure functionality and stability. ### What's changed <!-- Describe point by point the different things you have changed in this PR --> - Added GraphQL content type to the body. - Integrated a GraphQL Body component that includes Query and Variable fields. - Handled support for cURL functionality. - Enabled the import of GraphQL requests in the REST tab from Insomnia and Postman. - Added support for environment variables and predefined variables. - Updated expressions to replace all environment variables for Insomnia imports. ### Notes to reviewers <!-- Any information you feel the reviewer should know about when reviewing your PR --> https://github.com/user-attachments/assets/5d28eab4-1fc2-4fde-b00a-f555eaf25c88 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/hoppscotch#5066
No description provided.