feat: add Relay data fetching with mock GraphQL server#69
Conversation
Add rescript-relay with a bundled graphql-yoga mock server serving User and Post types. PostsPage fetches data via a Relay query with Suspense loading. App wraps in RelayEnvironmentProvider. Includes relay.config.js and generated Relay artifacts. Closes #35
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Warning Rate limit exceeded
Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 3 minutes and 21 seconds. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (3)
📒 Files selected for processing (10)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Use GRAPHQL_ENDPOINT env var (defaults to localhost:4000/graphql in dev). Add RescriptReactErrorBoundary to PostsPage that shows a helpful "server not running" message when the mock server is unavailable (e.g. on Vercel deployment).
Summary
rescript-relay4.4.1 with PPX for GraphQL queries in ReScriptgraphql-yogamock server atmock-server/serving User and Post typesRescriptRelayReact.Context.Providersrc/__generated__/bun run devnow starts ReScript watch + Rspack + mock GraphQL server concurrentlyNew files
mock-server/index.js— graphql-yoga with in-memory users/posts datamock-server/schema.graphql— GraphQL schema (Query, Mutation, User, Post, Node)relay.config.js— Relay compiler configsrc/relay/RelayEnv.res— Relay environment with fetch functionsrc/__generated__/— Relay compiler artifactsScripts
bun run dev:server— start mock GraphQL server on :4000bun run relay— run Relay compilerbun run relay:watch— watch modeTest plan
bun run relay— compiles 1 query successfullybun run res:build— 103 modules compiled, zero warningsbun run build— production build succeedsbun run test— all 18 tests passCloses #35