-
Notifications
You must be signed in to change notification settings - Fork 212
feat(graphiql): add data fetching hooks #6583
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
amcaplan
wants to merge
1
commit into
11-06-feat_graphiql_add_graphiql_editor_with_monaco_integration
Choose a base branch
from
11-06-feat_graphiql_add_data_fetching_hooks
base: 11-06-feat_graphiql_add_graphiql_editor_with_monaco_integration
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
feat(graphiql): add data fetching hooks #6583
amcaplan
wants to merge
1
commit into
11-06-feat_graphiql_add_graphiql_editor_with_monaco_integration
from
11-06-feat_graphiql_add_data_fetching_hooks
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This was referenced Nov 6, 2025
Contributor
Author
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
This was referenced Nov 6, 2025
Contributor
Coverage report
Show new covered files 🐣
Test suite run success3437 tests passing in 1399 suites. Report generated by 🧪jest coverage report action from eeb9b92 |
f1c8933 to
b9ab875
Compare
3b8bbcc to
2e1b3ee
Compare
b9ab875 to
5b82f74
Compare
2e1b3ee to
8ade16e
Compare
5b82f74 to
37969e0
Compare
37969e0 to
dbe1b3f
Compare
8ade16e to
70c73e5
Compare
70c73e5 to
a6fca5f
Compare
dbe1b3f to
3e5ff33
Compare
a6fca5f to
f6b80c1
Compare
3e5ff33 to
7479a72
Compare
f6b80c1 to
f574269
Compare
ba4433a to
34f9d5e
Compare
f574269 to
1e4b9d5
Compare
34f9d5e to
4ff7e34
Compare
33e19e2 to
fa9758f
Compare
4ff7e34 to
9cccb15
Compare
Adds custom React hooks for server status polling and data fetching. - Add usePolling hook for generic interval-based polling - Add useServerStatus hook for checking server health - Include comprehensive tests (386 lines) All hook tests pass
9cccb15 to
fbbce5d
Compare
fa9758f to
eeb9b92
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.

WHY are these changes introduced?
This PR adds custom React hooks for server health monitoring and data fetching. This is the sixth PR in the 8-PR migration stack.
Context: The current template-based GraphiQL implementation uses vanilla JavaScript with
setIntervalto poll the server for health status and app installation state. By creating reusable React hooks, we can:WHAT is this pull request doing?
This PR adds two custom hooks that replace vanilla JavaScript polling with React-based data fetching.
Key Changes:
1. usePolling Hook (
src/hooks/usePolling.ts):A generic hook for interval-based polling with proper cleanup and error handling.
Features:
useRefto avoid stale closure issuesUsage:
2. useServerStatus Hook (
src/hooks/useServerStatus.ts):Monitors server health and app installation status by polling two endpoints.
Two Polling Mechanisms:
Ping Polling (
/graphiql/ping- every 2 seconds by default):serverIsLivestateStatus Polling (
/graphiql/status- every 5 seconds by default):storeFqdn,appName,appUrl)appIsInstalledstate and store infoReturn Value:
Usage:
Error Handling:
Replaces:
setIntervalpolling logicTesting:
Files Added:
src/hooks/usePolling.ts- Generic polling hook (46 lines)src/hooks/usePolling.test.ts- Tests (176 lines)src/hooks/useServerStatus.ts- Server status hook (102 lines)src/hooks/useServerStatus.test.ts- Tests (210 lines)src/hooks/index.ts- Barrel exportsDependencies
Builds on:
Used by:
ServerStatustype)How to test your changes?
Manual Testing:
You can test the hooks in the App component:
Measuring impact
Checklist