[PR #3136] [MERGED] fix: graphql authorization headers #4243

Closed
opened 2026-03-17 01:47:50 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/hoppscotch/hoppscotch/pull/3136
Author: @anwarulislam
Created: 6/13/2023
Status: Merged
Merged: 6/22/2023
Merged by: @AndrewBastin

Base: release/2023.4.7Head: fix/gql-authorization-headers


📝 Commits (3)

  • ae8a448 fix: graphql authorization headers
  • 872eaa5 fix: auth object updating issue
  • c94ffd0 feat: added persistence for gql

📊 Changes

8 files changed (+105 additions, -27 deletions)

View changed files

📝 packages/hoppscotch-common/src/components.d.ts (+1 -0)
📝 packages/hoppscotch-common/src/components/graphql/Authorization.vue (+22 -4)
📝 packages/hoppscotch-common/src/components/graphql/Request.vue (+13 -2)
📝 packages/hoppscotch-common/src/components/smart/EnvInput.vue (+3 -1)
📝 packages/hoppscotch-common/src/helpers/GQLConnection.ts (+38 -6)
📝 packages/hoppscotch-common/src/newstore/GQLSession.ts (+1 -4)
📝 packages/hoppscotch-common/src/newstore/localpersistence.ts (+25 -0)
📝 packages/hoppscotch-common/src/pages/graphql.vue (+2 -10)

📄 Description

Closes #3135

🤖 Generated by Copilot at 2091437

Summary

This pull request fixes the Authorization config not being added to headers in GraphQL. And it removes environment highlights on Authorization field on GraphQL as env support doesn't yet have in GQL

GQLConnection
Authenticates requests now
Winter of secrets

Walkthrough

  • Add environmentHighlights prop to SmartEnvInput component to control environment variable highlighting (link, link, link, link, link, link, link)
  • Import and use gqlAuth$ stream from GQLSession store to get authentication information for GraphQL request in Request.vue (link, link)
  • Pass auth variable to connect and getSchema methods of GQLConnection class in Request.vue and GQLConnection.ts to send authentication information along with URL and headers when connecting to GraphQL endpoint (link, link, link, link)
  • Handle different authentication types and add corresponding headers to request in getSchema method of GQLConnection class in GQLConnection.ts (link)

🔄 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/3136 **Author:** [@anwarulislam](https://github.com/anwarulislam) **Created:** 6/13/2023 **Status:** ✅ Merged **Merged:** 6/22/2023 **Merged by:** [@AndrewBastin](https://github.com/AndrewBastin) **Base:** `release/2023.4.7` ← **Head:** `fix/gql-authorization-headers` --- ### 📝 Commits (3) - [`ae8a448`](https://github.com/hoppscotch/hoppscotch/commit/ae8a448075e8bb18d51c315d2c0adc8cc30e48c5) fix: graphql authorization headers - [`872eaa5`](https://github.com/hoppscotch/hoppscotch/commit/872eaa55e8e9d5b8baac3805af5f36a471aff1f6) fix: auth object updating issue - [`c94ffd0`](https://github.com/hoppscotch/hoppscotch/commit/c94ffd0b6aabb50ea1bd4376442163c94cd079ab) feat: added persistence for gql ### 📊 Changes **8 files changed** (+105 additions, -27 deletions) <details> <summary>View changed files</summary> 📝 `packages/hoppscotch-common/src/components.d.ts` (+1 -0) 📝 `packages/hoppscotch-common/src/components/graphql/Authorization.vue` (+22 -4) 📝 `packages/hoppscotch-common/src/components/graphql/Request.vue` (+13 -2) 📝 `packages/hoppscotch-common/src/components/smart/EnvInput.vue` (+3 -1) 📝 `packages/hoppscotch-common/src/helpers/GQLConnection.ts` (+38 -6) 📝 `packages/hoppscotch-common/src/newstore/GQLSession.ts` (+1 -4) 📝 `packages/hoppscotch-common/src/newstore/localpersistence.ts` (+25 -0) 📝 `packages/hoppscotch-common/src/pages/graphql.vue` (+2 -10) </details> ### 📄 Description Closes #3135 <!-- copilot:all --> ### <samp>🤖 Generated by Copilot at 2091437</samp> ### Summary This pull request fixes the Authorization config not being added to headers in GraphQL. And it removes environment highlights on Authorization field on GraphQL as env support doesn't yet have in GQL > _`GQLConnection`_ > _Authenticates requests now_ > _Winter of secrets_ ### Walkthrough * Add `environmentHighlights` prop to `SmartEnvInput` component to control environment variable highlighting ([link](https://github.com/hoppscotch/hoppscotch/pull/3136/files?diff=unified&w=0#diff-ff8bedda71a90ead557a88ca19c335becf4d9bf0328f8add3a32ebbaf7e12b40R145), [link](https://github.com/hoppscotch/hoppscotch/pull/3136/files?diff=unified&w=0#diff-ff8bedda71a90ead557a88ca19c335becf4d9bf0328f8add3a32ebbaf7e12b40R152), [link](https://github.com/hoppscotch/hoppscotch/pull/3136/files?diff=unified&w=0#diff-ff8bedda71a90ead557a88ca19c335becf4d9bf0328f8add3a32ebbaf7e12b40L158-R173), [link](https://github.com/hoppscotch/hoppscotch/pull/3136/files?diff=unified&w=0#diff-ff8bedda71a90ead557a88ca19c335becf4d9bf0328f8add3a32ebbaf7e12b40L169-R190), [link](https://github.com/hoppscotch/hoppscotch/pull/3136/files?diff=unified&w=0#diff-77b8f4b02b324137697f8b9f9666a4109da9f05ffca983065e49f7ff302de548R47), [link](https://github.com/hoppscotch/hoppscotch/pull/3136/files?diff=unified&w=0#diff-77b8f4b02b324137697f8b9f9666a4109da9f05ffca983065e49f7ff302de548R57), [link](https://github.com/hoppscotch/hoppscotch/pull/3136/files?diff=unified&w=0#diff-77b8f4b02b324137697f8b9f9666a4109da9f05ffca983065e49f7ff302de548L145-R147)) * Import and use `gqlAuth$` stream from `GQLSession` store to get authentication information for GraphQL request in `Request.vue` ([link](https://github.com/hoppscotch/hoppscotch/pull/3136/files?diff=unified&w=0#diff-21140ccefcd7ad2a17c48a1f2af4f1d738e073d434fbbc5d4a30eb17579b6c6cL34-R39), [link](https://github.com/hoppscotch/hoppscotch/pull/3136/files?diff=unified&w=0#diff-21140ccefcd7ad2a17c48a1f2af4f1d738e073d434fbbc5d4a30eb17579b6c6cR49-R52)) * Pass `auth` variable to `connect` and `getSchema` methods of `GQLConnection` class in `Request.vue` and `GQLConnection.ts` to send authentication information along with URL and headers when connecting to GraphQL endpoint ([link](https://github.com/hoppscotch/hoppscotch/pull/3136/files?diff=unified&w=0#diff-21140ccefcd7ad2a17c48a1f2af4f1d738e073d434fbbc5d4a30eb17579b6c6cL49-R58), [link](https://github.com/hoppscotch/hoppscotch/pull/3136/files?diff=unified&w=0#diff-f683d1d71a52fb88829fa4213632f582fefcbd731887006523bc98c050cab8c8L102-R102), [link](https://github.com/hoppscotch/hoppscotch/pull/3136/files?diff=unified&w=0#diff-f683d1d71a52fb88829fa4213632f582fefcbd731887006523bc98c050cab8c8L113-R113), [link](https://github.com/hoppscotch/hoppscotch/pull/3136/files?diff=unified&w=0#diff-f683d1d71a52fb88829fa4213632f582fefcbd731887006523bc98c050cab8c8L138-R142)) * Handle different authentication types and add corresponding headers to request in `getSchema` method of `GQLConnection` class in `GQLConnection.ts` ([link](https://github.com/hoppscotch/hoppscotch/pull/3136/files?diff=unified&w=0#diff-f683d1d71a52fb88829fa4213632f582fefcbd731887006523bc98c050cab8c8L146-R181)) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-17 01:47:50 +03:00
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#4243
No description provided.