Add React GraphQL learning website - #2
Merged
Conversation
Co-authored-by: charles2ke <6725706+charles2ke@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
charles2ke
August 27, 2026 09:39
View session
charles2ke
approved these changes
Aug 27, 2026
There was a problem hiding this comment.
🟡 Changes recommended
The new Explorer request handling and navigation have concrete correctness issues, and the website docs/tooling requirements need alignment to avoid setup failures.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Adds a new React/Vite “learning website” subproject to complement the existing GraphQL demo service, including a simple interactive explorer that can POST operations to the local /graphql endpoint (via Vite proxy) and documentation to run it locally.
Changes:
- Introduces a new
website/React/Vite app with a Learn page and an API Explorer UI. - Configures local development proxying of
/graphqltohttp://localhost:4000. - Updates the repo root README with website setup and proxy usage notes.
File summaries
| File | Description |
|---|---|
| README.md | Documents how to run the new learning website alongside the API service. |
| website/vite.config.js | Adds Vite dev server proxy for /graphql to the local API server. |
| website/src/main.jsx | React entry point mounting the app. |
| website/src/index.css | Global styles + Google Fonts import. |
| website/src/App.jsx | Implements Learn + Explorer pages and hash-based navigation. |
| website/src/App.css | Site styling for the pages and explorer layout. |
| website/index.html | Vite HTML entry document for the website. |
| website/package.json | Adds website project dependencies/scripts. |
| website/package-lock.json | Locks website dependencies for reproducible installs. |
| website/.oxlintrc.json | Configures Oxlint rules for the website code. |
| website/.gitignore | Ignores typical Vite/Node build and editor artifacts. |
| website/README.md | Adds a website-specific README (currently template content). |
| website/public/icons.svg | Adds SVG sprite for UI icons. |
| website/public/favicon.svg | Adds favicon. |
| website/src/assets/vite.svg | Adds Vite logo asset. |
| website/src/assets/react.svg | Adds React logo asset. |
Review details
Files not reviewed (2)
- website/package-lock.json: Generated file
- website/src/App.css: Generated file
- Files reviewed: 10/17 changed files
- Comments generated: 6
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+97
to
+105
| const response = await fetch(import.meta.env.VITE_GRAPHQL_URL || '/graphql', { | ||
| method: 'POST', | ||
| headers: { 'Content-Type': 'application/json' }, | ||
| body: JSON.stringify({ query }), | ||
| }) | ||
| const body = await response.json() | ||
| setResult(JSON.stringify(body, null, 2)) | ||
| } catch (error) { | ||
| setResult(JSON.stringify({ error: 'Unable to reach the GraphQL server.', detail: error.message }, null, 2)) |
| return ( | ||
| <> | ||
| <header className="site-header"> | ||
| <a className="brand" href="#/" onClick={() => navigate('learn')}><span>◈</span> GraphQL <em>field guide</em></a> |
| <meta charset="UTF-8" /> | ||
| <link rel="icon" type="image/svg+xml" href="/favicon.svg" /> | ||
| <meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
| <title>website</title> |
Comment on lines
+5
to
+6
| "type": "module", | ||
| "scripts": { |
Comment on lines
+63
to
+68
| Keep the API server running on port `4000`, then open the URL printed by Vite | ||
| (normally <http://localhost:5173>). The API Explorer is available at | ||
| `/#explorer`. During development, Vite proxies `/graphql` requests to the local | ||
| API. To target a different API, start Vite with `VITE_GRAPHQL_URL` set to its | ||
| GraphQL endpoint. | ||
|
|
Comment on lines
+1
to
+16
| # React + Vite | ||
|
|
||
| This template provides a minimal setup to get React working in Vite with HMR and some Oxlint rules. | ||
|
|
||
| Currently, two official plugins are available: | ||
|
|
||
| - [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react) uses [Oxc](https://oxc.rs) | ||
| - [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react-swc) uses [SWC](https://swc.rs/) | ||
|
|
||
| ## React Compiler | ||
|
|
||
| The React Compiler is not enabled on this template because of its impact on dev & build performances. To add it, see [this documentation](https://react.dev/learn/react-compiler/installation). | ||
|
|
||
| ## Expanding the Oxlint configuration | ||
|
|
||
| If you are developing a production application, we recommend using TypeScript with type-aware lint rules enabled. Check out the [TS template](https://github.com/vitejs/vite/tree/main/packages/create-vite/template-react-ts) for information on how to integrate TypeScript and Oxlint's TypeScript related rules in your project. |
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
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.
Summary
Validation
npm testcd website && npm run lint && npm run build