apollo-server-express 是 Apollo Server 的一部分,專為與 Express 應用集成而設計。它提供了許多強大的功能,如內建的快取、錯誤處理、以及對 GraphQL 設計的全面支持。Apollo Server 的生態系統非常龐大,並且擁有豐富的工具和插件,適合需要高效能和可擴展性的應用程序。對於希望利用 Apollo 的生態系統和工具的開發者來說,apollo-server-express 是一個理想的選擇。
graphql-yoga 是一個靈活且易於使用的 GraphQL 伺服器,旨在簡化 GraphQL 的設置過程。它基於 Apollo Server 和其他流行的 GraphQL 庫,提供了一個開箱即用的解決方案,適合快速開發和原型設計。graphql-yoga 支持即時訂閱、文件上傳等功能,並且可以輕鬆地與現有的 Node.js 應用集成。如果你需要一個簡單且功能強大的 GraphQL 伺服器,graphql-yoga 是一個不錯的選擇。
This is the Express integration of Apollo Server. Apollo Server is a community-maintained open-source GraphQL server that works with many Node.js HTTP server frameworks. Read the docs. Read the CHANGELOG.
A full example of how to use apollo-server-express can be found in the docs.
Before Apollo Server 3, we officially supported using this package with connect as well. connect is an older framework that express evolved from. For now, we believe that this package is still compatible with connect and we even run tests against connect, but we may choose to break this compatibility at some point without a major version bump. If you rely on the ability to use Apollo Server with connect, you may wish to make your own integration.
Principles
GraphQL Server is built with the following principles in mind:
By the community, for the community: GraphQL Server's development is driven by the needs of developers
Simplicity: by keeping things simple, GraphQL Server is easier to use, easier to contribute to, and more secure
Performance: GraphQL Server is well-tested and production-ready - no modifications needed
Anyone is welcome to contribute to GraphQL Server, just read CONTRIBUTING.md, take a look at the roadmap and make your first PR!