Deno
Using Grats in a Deno project, serving the generated schema with Deno.serve.
Grats is a native binary, so it doesn't need Node to run: deno run -A npm:grats is enough.
Deno projects do need two settings which other projects don't, because Grats resolves imports through node_modules and reads its configuration from tsconfig.json:
- A
node_modulesdirectory, so Grats can resolve thegratspackage and read the docblocks which defineInt,FloatandID. Projects with apackage.jsonget one automatically; projects with only adeno.jsonneed"nodeModulesDir": "auto". importModuleSpecifierEndingset to.ts, since Deno requires an extension on relative imports and Grats omits it by default.
The example's README explains both, including the errors you get without them.
https://github.com/captbaritone/grats/tree/main/examples/deno
Libraries used
graphql-httpgraphql-js