What is the difference between Apollo Server v3 and v4?
Answer
Apollo Server v4 (released 2022) introduced major architectural changes from v3. Key differences: (1) Framework integration: v4 is framework-agnostic — no built-in Express integration. Use startStandaloneServer for simple setups or expressMiddleware for Express integration (separate package). (2) Removed built-in landing page: no embedded GraphQL Playground; replaced by Apollo Sandbox link. (3) Plugin system overhaul: cleaner hook-based plugin API. (4) Built-in TypeScript: written in TypeScript, better type inference. (5) No more subscriptions integration: subscriptions must be set up separately with graphql-ws. (6) CSRF prevention by default. (7) HTTP batching removed by default. (8) Better error handling: error formatting is more controlled. Migration from v3 to v4 requires updating server initialization and subscription setup.
Previous
What is query complexity analysis in GraphQL?
Next
What is urql and how does it compare to Apollo Client?
More GraphQL Questions
View all →- Intermediate How do you implement pagination in GraphQL?
- Intermediate What is the Relay specification in GraphQL?
- Intermediate How do you implement authorization in GraphQL resolvers?
- Intermediate What is graphql-shield and how does it work?
- Intermediate How do you implement real-time subscriptions with GraphQL?