mirror of
https://github.com/hoppscotch/hoppscotch.git
synced 2026-04-26 01:06:00 +03:00
[PR #4523] [MERGED] hotfix: graphql connection error handler #4843
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#4843
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/4523
Author: @anwarulislam
Created: 11/7/2024
Status: ✅ Merged
Merged: 11/12/2024
Merged by: @jamesgeorge007
Base:
patch← Head:hotfix/graphql-connection-handler📝 Commits (7)
69d4f87fix: graphql connection error handler0ae40f5fix: prevent infinite loading state while connectingbf21040fix: handle graphql connection error and display error message82cbed4fix: account for connection error state53a1858chore: prevent showing connection error toast while sending a requesta7dfaabchore: show an error toast if any schema fetch attempt failsc2e5e7ffix: 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
Connectbutton. 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-200status 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.