English for Blitz.js Developers
Learn the English vocabulary for Blitz.js: zero-API data layer, resolvers, and explaining a full-stack React framework built on Next.js.
Blitz.js conversations tend to focus on defending its “zero-API” model, where frontend code calls backend functions directly without hand-written REST or GraphQL endpoints, so the vocabulary covers queries, mutations, and how the framework hides the network boundary.
Key Vocabulary
Zero-API layer — Blitz.js’s approach of letting React components import and call backend functions directly, with the framework transparently turning those calls into network requests behind the scenes. “With the zero-API layer, you’re not maintaining a separate REST endpoint for every mutation — the component just imports the function and calls it like it’s local.”
Query resolver — a Blitz.js backend function, colocated with the pages that use it, responsible for fetching and returning data, automatically wired into React Query on the frontend. “This query resolver already handles caching through React Query — you don’t need to add your own fetch-and-cache logic in the component.”
Mutation resolver — a Blitz.js backend function that performs a write operation (create, update, delete) and can be invoked directly from a client component with automatic loading and error states.
“Wrap the button handler around this mutation resolver — Blitz gives you the pending state for free, so you don’t need your own isSubmitting flag.”
Colocation — Blitz.js’s convention of placing backend resolver files inside the same feature folder as the frontend pages that consume them, rather than splitting frontend and backend into separate top-level directories.
“Because of colocation, the resolver for this page lives right next to it in the same folder — you don’t have to go hunting through a separate api/ tree.”
Authorization middleware (resolver pipe) — a chain of functions wrapped around a query or mutation resolver to handle authentication and authorization checks before the resolver’s core logic runs. “Add the session guard to the resolver pipe instead of checking permissions manually inside the function — that way every consumer of this resolver gets the same enforcement.”
Common Phrases
- “Does this need a full REST endpoint, or can it just be a query resolver called directly from the component?”
- “Is this mutation resolver handling its own error state, or do we need to catch that in the calling component?”
- “Should this resolver live here because of colocation, or does it actually belong in a shared folder?”
- “Is the authorization check happening in the resolver pipe, or did someone put it inside the function body by mistake?”
Example Sentences
Explaining the framework’s philosophy to a new developer: “Blitz’s zero-API layer means you never write a fetch call for this — you literally import the resolver function and call it, and Blitz handles the network request under the hood.”
Reviewing file structure: “Because of colocation, this resolver should be moved next to the page that uses it, not left in a generic backend folder.”
Explaining security review comments: “Put the ownership check into the resolver pipe rather than the top of the function — that way it’s applied consistently and easier to audit.”
Professional Tips
- Use zero-API layer to explain why there’s no visible REST or GraphQL contract in the codebase — it prevents confused searches for endpoint definitions.
- Distinguish query resolver and mutation resolver precisely in review comments, since they have different caching and invalidation behavior in React Query.
- Reference colocation when explaining folder structure to developers used to a strict frontend/backend split — it changes where they should expect to find things.
- Recommend centralizing checks in the resolver pipe during security review, since scattered manual permission checks are harder to audit consistently.
Practice Exercise
- Explain what the zero-API layer means and how it changes the way a component calls backend logic.
- Describe the difference between a query resolver and a mutation resolver in terms of what each is used for.
- Write a review comment asking a teammate to move an authorization check into the resolver pipe.