CodeVetter · Repo Unpack · Data flow
redwoodjs/redwood
Application configuration determines paths, endpoints, feature flags, and browser-exposed values. Browser queries travel through Cell hooks and Apollo links to Yoga, where SDL fields map to service exports and application-owned Prisma clients. Authentication adds identity to request-scoped context before resolver execution. Jobs use a separate durable path that serializes invocation metadata into database records and later loads compiled code in workers.
- getRawConfig reads and interpolates TOML; getConfig merges the parsed values with defaults such as web port 8910, API port 8911, and /.redwood/functions.
- getEnvVarDefinitions converts configuration into RWJS_ENV endpoint/title/feature values and exposes both explicitly included environment variables and REDWOOD_ENV_ prefixed values to browser expressions.
- NamedCell removes children from query-variable derivation, runs beforeQuery, resolves a static or functional QUERY, and calls the GraphQLHooksProvider useQuery hook.
- Apollo obtains getToken for each operation, adds auth-provider and Bearer authorization headers, and sends operations through upload, SSE, or persisted-operation terminating links.
- The Fastify GraphQL handler supplies a Lambda-shaped event alongside req/reply to yoga.handleNodeRequest, then copies response headers, status, and body into the Fastify reply.
- getAuthenticationContext prefers an auth-provider-bearing cookie over provider-header authorization, runs configured decoders until a payload is returned, and passes the result to getCurrentUser through the auth-context plugin.
- makeMergedSchema combines SDL, directive, subscription, and root definitions; service exports matching field names receive GraphQL args followed by root/context/info.
- The todo mutation passes a body string from React state into createTodo, stores it through db.todo.create, and appends the returned Todo to Apollo's cached list.
- Job scheduling converts job name/path/args, queue, priority, and computed runAt into a payload; PrismaAdapter persists invocation metadata as JSON in the handler column.
- PrismaAdapter selects jobs by priority/runAt, conditionally updates a candidate's lock and attempt count, reloads the record, and deserializes name/path/args for Executor.
- FileSystemStorage turns a File arrayBuffer into a Node Buffer at a configured or overridden path; UrlSigner binds a path and optional expiry into an HMAC and returns a decoded path after validation.