Production App
This example includes a relatively fully featured app to demonstrate how real-world applications can be built with Grats.
https://github.com/captbaritone/grats/tree/main/examples/production-app/
Features
- Node interface
- dataloader
- Connections (as used by Relay)
- Subscriptions - See
Subscription.postLikesinmodels/LikeConnection.ts @stream- For expensive lists likeViewer.feedinmodels/Viewer.ts- Custom scalars - See
Datedefined ingraphql/CustomScalars.ts
Implementation notes
Dataloaders are attached to the per-request viewer context. This enables per-request caching while avoiding the risk of leaking data between requests/users.
The viewer context is passed all the way through the app to the data layer. This would enable permission checking to be defined as close to the data as possible.
Libraries used
graphql-yogagraphql-jsdataloader@graphql-yoga/plugin-defer-streamgraphql-relay