Skip to content

Add React GraphQL learning website - #2

Merged
charles2ke merged 1 commit into
mainfrom
copilot/add-react-graphql-website
Aug 27, 2026
Merged

Add React GraphQL learning website#2
charles2ke merged 1 commit into
mainfrom
copilot/add-react-graphql-website

Conversation

Copilot AI commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add a React/Vite learning website covering GraphQL fundamentals and practical tips.
  • Add an interactive API Explorer for running sample queries and mutations against the demo service.
  • Document local website development and proxy configuration.

Validation

  • npm test
  • cd website && npm run lint && npm run build
  • Verified the Vite proxy can query the local GraphQL API
  • Secrets scan and CodeQL: no alerts

Co-authored-by: charles2ke <6725706+charles2ke@users.noreply.github.com>
@charles2ke
charles2ke marked this pull request as ready for review August 27, 2026 09:40
@charles2ke
charles2ke requested a lite review from Copilot August 27, 2026 09:40
@charles2ke
charles2ke merged commit 6e43f6b into main Aug 27, 2026
2 checks passed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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 /graphql to http://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 thread website/src/App.jsx
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))
Comment thread website/src/App.jsx
return (
<>
<header className="site-header">
<a className="brand" href="#/" onClick={() => navigate('learn')}><span>◈</span> GraphQL <em>field guide</em></a>
Comment thread website/index.html
<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 thread website/package.json
Comment on lines +5 to +6
"type": "module",
"scripts": {
Comment thread README.md
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 thread website/README.md
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants