class

Analyzer::Specification::Hasura

Inherits Analyzer::Specification::SchemaApiCommon < Analyzer::Specification::SpecificationEngine < Analyzer < FileHelper < Reference < Object

Hasura does not generate per-table REST routes. A tracked table becomes a set of GraphQL root fields on POST /v1/graphql; the only REST surface is whatever metadata/rest_endpoints.yaml declares. Emitting /api/rest/<table> would invent endpoints that 404.

Rather than re-deriving GraphQL handling, each tracked table is rendered as a small SDL document and handed to GraphqlSdlParser. That yields the fragment URL convention (/v1/graphql#Query.movies), a runnable operation document per field, and input-object expansion into dotted params — all of which the SDL analyzer already does.

Constants

GRAPHQL_IDENTIFIER = /\A[A-Za-z_][A-Za-z0-9_]*\z/

Column names must be valid GraphQL identifiers to appear in the synthesized SDL.

GRAPHQL_PATH = "/v1/graphql"
PERMISSION_KEYS = {"select_permissions", "insert_permissions", "update_permissions", "delete_permissions"}

Hasura's metadata carries no column list of its own; column-level permissions are the only place columns are named.

REST_PREFIX = "/api/rest"
TAG_SOURCE = "hasura_analyzer"

Class methods

tech_name
Source

Instance methods

analyze
Source
tech

Instance-side view of the same declaration. The per-file rescues live on this base class, which has no way to name the analyzer that is running inside them, so a skipped file could not be attributed to a tech. Deriving it from analyzer_for keeps the name written exactly once.

Source