How fabriceibols/starwars-apollo works
StarWars Api Typescript is a React character browser backed by an Apollo GraphQL API. A user opens the people list, follows a character’s Details link, and views that character’s details; the client’s Apollo provider is configured with the API endpoint. On the server, Apollo combines the schema, resolvers, and REST data source; resolvers request character data from SWAPI, which the data source reduces to the fields exposed by GraphQL. The README confirms the API and SPA but gives few details; relationships below are limited to the sampled source and documented setup.
Main entry points: App.tsx App and routes · index.ts Apollo server · people.ts People REST source · index.tsx React bootstrap
Components 10
React client
- React bootstrap
client/src/index.tsx - App and routes
client/src/App.tsx - People list
client/src/components/People.tsx - Person details
client/src/components/Person.tsx
GraphQL API
- Apollo server
src/index.ts - GraphQL schema
src/schema.ts - Query resolvers
src/resolvers.ts
Character data
- People REST source
src/datasource/people.ts
Other components
- Browser user
- SWAPI
Connections 11
- Browser user → React bootstrap: opens
- React bootstrap → App and routes: renders
client/src/index.tsx - App and routes → People list: routes to
client/src/App.tsx - App and routes → Person details: routes to
client/src/App.tsx - People list → Person details: links to
client/src/components/People.tsx - App and routes → Apollo server: configures endpoint
client/src/App.tsx - Apollo server → GraphQL schema: loads
src/index.ts - Apollo server → Query resolvers: loads
src/index.ts - Apollo server → People REST source: registers
src/index.ts - Query resolvers → People REST source: calls
src/resolvers.ts - People REST source → SWAPI: fetches people
src/datasource/people.ts