Analyzer::Specification::GraphqlSdlParser
Shared GraphQL SDL parser. Extracted from GraphqlSdl so other
analyzers (Apollo Server's inline gql\...`` typeDefs, Yoga, etc.)
can produce the same field-per-endpoint shape without re-implementing
the SDL grammar.
Constants
DEFAULT_GRAPHQL_PATH = "/graphql"
ROOT_OPERATIONS = {"Query" => "query", "Mutation" => "mutation", "Subscription" => "subscription"}
Root operation type → GraphQL operation keyword.
All operations ride on POST (Noir's URL optimizer dedupes on method+url and
the HTTP method allowlist doesn't include WS); subscriptions are flagged
via endpoint.protocol = "ws" and a tag instead.
Instance methods
parse(content : String, file_path : String, default_path : String = DEFAULT_GRAPHQL_PATH, tag_source : String = "graphql_sdl_analyzer", line_offset : Int32 = 0) : Array(Endpoint)
Parse an SDL document and return one endpoint per Query/Mutation/Subscription
field. line_offset shifts every reported line number — used by host
analyzers (e.g. Apollo Server) whose SDL is embedded in a larger file.