2026-04-13 00:37:44 +03:00
|
|
|
# Omnigraph Cheat Sheet
|
|
|
|
|
|
|
|
|
|
## Local Query Validation
|
|
|
|
|
|
|
|
|
|
Use an explicit schema file:
|
|
|
|
|
|
|
|
|
|
```bash
|
2026-05-23 13:34:28 +00:00
|
|
|
omnigraph lint --query ./queries.gq --schema ./schema.pg --json
|
|
|
|
|
omnigraph check --query ./queries.gq --schema ./schema.pg
|
2026-04-13 00:37:44 +03:00
|
|
|
```
|
|
|
|
|
|
|
|
|
|
Use a local or `s3://` repo target:
|
|
|
|
|
|
|
|
|
|
```bash
|
2026-05-23 13:34:28 +00:00
|
|
|
omnigraph lint --query ./queries.gq ./repo.omni --json
|
|
|
|
|
omnigraph check --query ./queries.gq s3://bucket/repo
|
2026-04-13 00:37:44 +03:00
|
|
|
```
|
|
|
|
|
|
|
|
|
|
Use `omnigraph.yaml` target resolution:
|
|
|
|
|
|
|
|
|
|
```bash
|
2026-05-23 13:34:28 +00:00
|
|
|
omnigraph lint --query ./queries.gq --target local --config ./omnigraph.yaml
|
2026-04-13 00:37:44 +03:00
|
|
|
```
|
|
|
|
|
|
2026-05-23 13:34:28 +00:00
|
|
|
> The previous `omnigraph query lint` / `omnigraph query check` spellings
|
|
|
|
|
> are kept as deprecated argv shims that print a one-line warning to
|
|
|
|
|
> stderr and rewrite to the canonical `omnigraph lint` / `omnigraph check`.
|
|
|
|
|
|
2026-04-13 00:37:44 +03:00
|
|
|
## What It Checks
|
|
|
|
|
|
|
|
|
|
- parses every query in the file
|
|
|
|
|
- typechecks each query against the resolved schema
|
|
|
|
|
- warns on hardcoded mutation queries with no params
|
|
|
|
|
- warns when nullable node fields have no update-query coverage
|
|
|
|
|
|
|
|
|
|
## Current Limits
|
|
|
|
|
|
|
|
|
|
- repo-backed lint is local/S3-only in v1
|
|
|
|
|
- HTTP targets need `--schema`
|
|
|
|
|
- exit code is nonzero only when there are strict validation errors
|