[PR #4523] [MERGED] hotfix: graphql connection error handler #4843

Closed
opened 2026-03-17 02:20:35 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/hoppscotch/hoppscotch/pull/4523
Author: @anwarulislam
Created: 11/7/2024
Status: Merged
Merged: 11/12/2024
Merged by: @jamesgeorge007

Base: patchHead: hotfix/graphql-connection-handler


📝 Commits (7)

  • 69d4f87 fix: graphql connection error handler
  • 0ae40f5 fix: prevent infinite loading state while connecting
  • bf21040 fix: handle graphql connection error and display error message
  • 82cbed4 fix: account for connection error state
  • 53a1858 chore: prevent showing connection error toast while sending a request
  • a7dfaab chore: show an error toast if any schema fetch attempt fails
  • c2e5e7f fix: toggle connection state if schema fetch attempt fails

📊 Changes

4 files changed (+55 additions, -15 deletions)

View changed files

📝 packages/hoppscotch-common/locales/en.json (+1 -0)
📝 packages/hoppscotch-common/src/components/graphql/RequestOptions.vue (+4 -1)
📝 packages/hoppscotch-common/src/helpers/graphql/connection.ts (+47 -13)
📝 packages/hoppscotch-common/src/pages/graphql.vue (+3 -1)

📄 Description

This pull request fixes the error handling for GraphQL connections. It adds a new error message for HTTP errors and updates the connection state to "ERROR" when an HTTP error occurs.

Context: Previously, attempting to send a request would toggle the connection state reflecting in the Connect button. However, the schema fetch doesn't happen, and the request goes through regardless of whether the introspection attempt fails. With #4516, the schema fetch attempt takes place before sending a request and a failure in this phase would affect the overall request execution flow. With the proposed changes, the introspection query (schema fetch) failing with a non-200 status code is accounted for with relevant error handlers ensuring the request execution goes through even if the schema fetch attempt fails.


🔄 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/4523 **Author:** [@anwarulislam](https://github.com/anwarulislam) **Created:** 11/7/2024 **Status:** ✅ Merged **Merged:** 11/12/2024 **Merged by:** [@jamesgeorge007](https://github.com/jamesgeorge007) **Base:** `patch` ← **Head:** `hotfix/graphql-connection-handler` --- ### 📝 Commits (7) - [`69d4f87`](https://github.com/hoppscotch/hoppscotch/commit/69d4f8778e85448f203e072abc2c6bdc441bc9e7) fix: graphql connection error handler - [`0ae40f5`](https://github.com/hoppscotch/hoppscotch/commit/0ae40f58e46d9995914a408f0e428984d01aab77) fix: prevent infinite loading state while connecting - [`bf21040`](https://github.com/hoppscotch/hoppscotch/commit/bf21040df500eeacd1b23e87b26052cc416aaca1) fix: handle graphql connection error and display error message - [`82cbed4`](https://github.com/hoppscotch/hoppscotch/commit/82cbed4354b95ab950d61ae13c12a2165adc138b) fix: account for connection error state - [`53a1858`](https://github.com/hoppscotch/hoppscotch/commit/53a1858684d435a0748e8b70edbb78ddf242a888) chore: prevent showing connection error toast while sending a request - [`a7dfaab`](https://github.com/hoppscotch/hoppscotch/commit/a7dfaabde183e47be41a143b1588ce7c3d6ae92b) chore: show an error toast if any schema fetch attempt fails - [`c2e5e7f`](https://github.com/hoppscotch/hoppscotch/commit/c2e5e7f7f172db2f0eaa86e251f6ae2292c94c0b) fix: toggle connection state if schema fetch attempt fails ### 📊 Changes **4 files changed** (+55 additions, -15 deletions) <details> <summary>View changed files</summary> 📝 `packages/hoppscotch-common/locales/en.json` (+1 -0) 📝 `packages/hoppscotch-common/src/components/graphql/RequestOptions.vue` (+4 -1) 📝 `packages/hoppscotch-common/src/helpers/graphql/connection.ts` (+47 -13) 📝 `packages/hoppscotch-common/src/pages/graphql.vue` (+3 -1) </details> ### 📄 Description This pull request fixes the error handling for GraphQL connections. It adds a new error message for HTTP errors and updates the connection state to "ERROR" when an HTTP error occurs. Context: Previously, attempting to send a request would toggle the connection state reflecting in the `Connect` button. However, the schema fetch doesn't happen, and the request goes through regardless of whether the introspection attempt fails. With #4516, the schema fetch attempt takes place before sending a request and a failure in this phase would affect the overall request execution flow. With the proposed changes, the introspection query (schema fetch) failing with a non-`200` status code is accounted for with relevant error handlers ensuring the request execution goes through even if the schema fetch attempt fails. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-17 02:20:35 +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#4843
No description provided.