# sortie-nav GraphQL API

Public, read-only GraphQL surface over the FAA NASR database and coded instrument procedures (CIFP).

**Endpoint:** `https://api.nav.sortie.co/graphql`

GET requests to the endpoint render GraphiQL in-browser. POST requests accept standard GraphQL queries.

## Products

- **[NASR](./nasr.md)** (v`e25086c3e952`, effective 2026-04-16) — FAA National Airspace System Resource — airports, runways, navaids, fixes, ATC facilities, airways, frequencies, ILS installations.
- **[CIFP](./cifp.md)** (v`239462ba9c35`, effective 2026-04-16) — FAA Coded Instrument Flight Procedures (ARINC 424) — SIDs, STARs, approaches, enroute airways, waypoints, controlled and restrictive airspace.

## Conventions

- **Pagination:** list queries accept `limit` (default 50, max 500) and `offset`.
- **Nullability:** every field is nullable. FAA data has nulls.
- **Naming:** SQL tables like `APT_BASE` become GraphQL types like `AptBase`; columns like `ARPT_ID` become fields like `arptId`.
- **Enums:** repeated code sets are deduplicated; messy codes fall back to `String`.
- **Versioning:** every 28-day cycle produces a new `version` (`sha256(url)[:12]`) per source. Query `source(id: "nasr") { version }` to detect updates for incremental sync.

## Getting started

```graphql
{
  airport(icaoId: "KSFO") {
    arptName
    city
    elevation
    aptRwy { rwyId rwyLen rwyWidth }
  }
  source(id: "nasr") { version effective }
}
```
