How juliendargelos/deno-graphql-api works
Project type and purpose
• This is a Deno‐based, modular GraphQL API template. It uses oak_graphql as the HTTP/GraphQL server and cotton as the ORM/migration tool. The goal is to let you drop in self‐contained “modules” (e.g., Article, User, Authentication) that each bring their own GraphQL types, resolvers, and data models.
File structure
• Top level:
• mod.ts — application entrypoint (boots Oak, cotton, loads modules)
• Dockerfile, .env, ormconfig.ts — containerization and DB config
• cache.ts, environment.ts, scripts.config.ts — runtime utilities and script hooks
• migrations/ — raw database migrations for cotton
• modules/
• core/ — autoloader, base Model, Module classes, shared resolvers and GraphQL types
• article/, user/, authentication/ — each defines its own GraphQL types.graphql, TypeScript model, resolvers, and exports via mod.ts
• Config files: importmap.json, lock.json, tsconfig.json
README for additional insights
• Outlines the “plugin” approach: each module exports models, resolvers, types
• Describes how cotton hooks models to DB tables, how oak_graphql uses the merged schema
• Highlights JWT authentication injected into the GraphQL context
Final recommendations
• Dynamic loading step prominently—this is the architectural heart of the template
• Migration workflow separately (cotton CLI → migrations folder → Database)
• Review the README’s “Scripts” section to add a “Dev Tools” cluster (denon, migrations, docker commands)