class

Analyzer::Javascript::GraphqlYoga

Inherits Analyzer::Javascript::JavascriptEngine < Analyzer < FileHelper < Reference < Object

GraphQL Yoga analyzer.

Yoga (The Guild stack) embeds its schema as an SDL string inside createSchema({ typeDefs }), and exposes the HTTP mount via the graphqlEndpoint option of createYoga(...). The host runtime (Node http, Express, Hono, Bun, Cloudflare Workers, …) only affects the base path; framework-specific analyzers already cover the mounting side, so this analyzer focuses on the SDL → endpoint translation and the graphqlEndpoint override.

The Apollo analyzer's mechanism is reused almost verbatim — both servers carry typeDefs as a backtick template literal — so the only Yoga-specific work here is reading graphqlEndpoint for the mount.

Constants

DEFAULT_GRAPHQL_PATH = "/graphql"
YOGA_HINTS_RE = Regex.union("graphql-yoga", "createYoga")

Cheap content hints used to gate the heavier SDL extraction. Precompiled once — a single PCRE2-JIT scan replaces two naive String#includes? substring scans. Regex.union auto-escapes each literal, so it is provably equivalent to the OR-of-includes? it replaces.

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