Inspect the live nSelf GraphQL API version, check deprecation status of fields and operations, and verify your client apps are on supported surfaces.
# Print the live API version and LTS window
nself api version
# Scan your GraphQL operations for deprecated fields
nself api deprecation-checknself api <SUBCOMMAND> [FLAGS]nself api provides tooling for operators who care about GraphQL API stability across upgrades. It surfaces two things: the version metadata of the running Hasura API (including which LTS window it falls in), and a deprecation scanner that reads your project's.graphql operation files and checks them against the live schema's @deprecated directives.
Running nself api deprecation-check as part of your CI pipeline catches usage of deprecated fields before they are removed in the next minor release. This is especially useful for teams that generate typed clients from the schema (via nself generate).
The --surface flag on api version lets you query a specific API surface (Hasura, Auth, or ping_api) instead of the default Hasura GraphQL endpoint.
Query the live API and print version, surface, Hasura build info, and LTS window.
nself api version
# Surface: hasura
# Version: v2.36.1
# CLI: v1.1.0
# LTS window: 2025-11-01 → 2026-11-01
# Status: supported
nself api version --surface auth
nself api version --json| Flag | Type | Default | Description |
|---|---|---|---|
--surface | string | hasura | API surface to query: hasura, auth, ping |
--json | bool | false | Output as JSON |
--timeout | int | 10 | Seconds to wait for the API response |
Scan all .graphql files in the project for operations that use fields or types marked @deprecated in the live schema. Prints a report of affected operations and the removal target version.
nself api deprecation-check
# OPERATION FILE DEPRECATED FIELD REMOVAL
# GetUserProfile queries/user.graphql user.legacyId v1.2.0
# ListProjects queries/projects.graphql project.archivedAt v1.2.0
nself api deprecation-check --json
nself api deprecation-check --dir ./src/graphql| Flag | Type | Default | Description |
|---|---|---|---|
--json | bool | false | Output results as JSON |
--dir | string | . | Directory to scan for .graphql files |
--fail-on-deprecated | bool | false | Exit code 1 if any deprecated usage found (useful for CI) |
nself api version --json | jq '.status'
# "supported"nself api deprecation-check --fail-on-deprecated
# exits 1 if any deprecated field found in .graphql filesnself api version --surface auth --json | jq '{version, lts_end}'nself api deprecation-check --dir ./apps/web/src/graphql --jsonNSELF_HASURA_ENDPOINT — Hasura GraphQL endpoint (default: from project .env)NSELF_HASURA_ADMIN_SECRET — Hasura admin secret for schema introspection0 — success (or no deprecated usage found)1 — API unreachable, or deprecated usage found when --fail-on-deprecated is set2 — invalid arguments