class
Analyzer::Javascript::Apollo
Overview
Apollo Server analyzer.
Extracts endpoints from two surfaces:
- Inline
typeDefsdeclarations carried in a backtick template literal (typeDefs = gql\...`ortypeDefs = `#graphql ...``), parsed via the shared GraphQL SDL parser. - The mount path — either an Express
app.use('/path', expressMiddleware(...))position or the standalone default of/graphql.
Schema-first setups that load typeDefs from a separate .graphql file
(import typeDefs from './schema.graphql') are handled by the
graphql_sdl analyzer, so no work is duplicated here.
Defined in:
analyzer/analyzers/javascript/apollo.crConstant Summary
-
APOLLO_HINTS =
["@apollo/server", "apollo-server", "ApolloServer"] -
File-level signals that mark a JS/TS file as Apollo-relevant. The parallel_file_scan walks every JS/TS source, so we gate with a cheap substring check before doing the heavier SDL extraction.
-
DEFAULT_GRAPHQL_PATH =
"/graphql"