A relay-inspired GraphQL data loading system for Next.js that provides normalized caching, batching, and automatic refetching. Version 0.5.0 is the current stable release with monthly updates. Key differentiators: integrates deeply with Next.js pages and routes, uses a normalized store like Relay but with a simpler API, and supports both client and server data fetching without schema introspection at runtime.
npm install rivet-graphqlNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows fetching GraphQL data on the server using RivetGraphQL instance, then consuming with useRivet hook in React.
Replace `uri` with `endpoint`.
Replace `rivet.query(query, variables)` with `rivet.query({ query, variables })`.Wrap your app or page with `<RivetGraphQLProvider client={rivet}>`.Use `refetch` returned from `useRivet` or call `rivet.query` again.
Ensure `"type": "module"` in package.json or use dynamic import().
Update import: `const rivet = new RivetGraphQL(...)` and call `rivet.query({ query, variables })`.Add `<RivetGraphQLProvider client={rivet}>` at the top level of your Next.js page or _app.tsx.