TypeScript Mongo Codegen
This project generates types for a seamless integration between GraphQL and MongoDB. Generate All CRUD and Pagination Operations (10 minutes or less)
Usage
yarn add ts-mongo-codegen
./codegen.json
./gql/books.schema
type Book @collection(name: "books") { id: ObjectId title: String author: String}
./src/stores/mongo.ts
{ const db = await const datastore = // datastore.books is a mongo collection return datastore}
Upcoming Release
- Augment your schema with CRUD operations for your collections.
- Generate a changelog to keep a running list of changes to a document
- Generate subscriptions
Turns This
Into This