https://github.com/mandx/denograts
https://github.com/mandx/denograts
deno graphql graphql-api graphql-server grats
Last synced: 4 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/mandx/denograts
- Owner: mandx
- License: mit
- Created: 2023-10-28T01:34:48.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-10-28T14:43:35.000Z (over 2 years ago)
- Last Synced: 2025-08-01T07:55:06.751Z (11 months ago)
- Topics: deno, graphql, graphql-api, graphql-server, grats
- Language: TypeScript
- Homepage:
- Size: 7.81 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# denograts
Extremely simple demo project exploring integration between [Grats](https://github.com/captbaritone/grats) and [Deno](https://deno.land/)
## Prerequisites
[Install Deno](https://docs.deno.com/runtime/manual#install-deno)
## Running the server:
```
$ deno run -A server.ts
```
## Generating the schema
```
$ deno run npm:grats/dist/src/cli.js --output=./schema.graphql
```
Not as pretty as just typing `npx grats`, but one can always stuff that command as a [Deno task](https://docs.deno.com/runtime/manual/tools/task_runner):
```
$ deno task grats-gen
```
## Issues specific to Deno (so far)
* Scalars provided by Grats (`import { Float, Int, ID } from "grats"`) are importable just fine, but seems like the docblocks aren't reachable.
* Kinda makes sense: these imports are importmaps managed by Deno; I'm guessing Grat's Typescript compiler can't locate the actual file where the scalars are defined, the file containing the scalars' dockblocks.
* A not-so-terrible workaround is to "vendor" the scalar definitions, so they are fully accessible by Grat's (see `schema.ts` in this repo).
* Module remapping must be done carefully to ensure a single `graphql` version is pulled, otherwise `graphql` itself will complain.