用于在 Kotlin 应用中调用 GraphQL API,自动从 GraphQL 定义生成强类型模型,免去手动解析 JSON 的麻烦。支持 Android 及 Kotlin Multiplatform,类型与操作强关联,确保只访问声明的字段。【此简介由AI生成】
Access rate limit exceeded. Please log in to continue.
| ☑️ Apollo Clients User Survey |
|---|
| What do you like best about Apollo Kotlin? What needs to be improved? Please tell us by taking a one-minute survey. Your responses will help us understand Apollo Kotlin usage and allow us to serve you better. |
🚀 Apollo Kotlin
Apollo Kotlin is a strongly typed GraphQL client that generates Kotlin models for your GraphQL operations.
Apollo Kotlin executes operations against a GraphQL server and returns results as operation-specific Kotlin types. This means you don't have to deal with parsing JSON, or passing around Maps and making clients cast values to the right type manually. You also don't have to write model types yourself, because these are generated from the GraphQL definitions your app uses.
Because generated types are operation-specific, you can only access data that you actually specify as part of an operation. If you don't ask for a particular field in an operation, you can't access the corresponding property on the returned data structure.
This library is designed with Android in mind, but you can use it in any Kotlin application, including KMP (Kotlin Multi Platform).
Apollo Kotlin aims to comply with the Working Draft of the GraphQL specification.
📚 Documentation
All Apollo Kotlin documentation, including caching and helpful recipes, can be found at:
https://www.apollographql.com/docs/kotlin/
The Apollo Kotlin API reference can be found at:
https://apollographql.github.io/apollo-kotlin/kdoc/
Tutorials can be found in the Odyssey learning platform: part1, part2.
👨💻 Who is Apollo?
Apollo builds open-source tools and commercial services to make application development easier, better, and accessible to more people. We help you ship faster with:
- GraphOS - The platform for building, managing, and scaling a supergraph: a unified network of your organization's microservices and their data sources—all composed into a single distributed API.
- Apollo Federation – The industry-standard open architecture for building a distributed graph. Use Apollo’s gateway to compose a unified graph from multiple subgraphs, determine a query plan, and route requests across your services.
- Apollo Client – The most popular GraphQL client for the web. Apollo also builds and maintains Apollo iOS and Apollo Kotlin.
- Apollo Server – A production-ready JavaScript GraphQL server that connects to any microservice, API, or database. Compatible with all popular JavaScript frameworks and deployable in serverless environments.
🎓 Learn how to build with Apollo
Check out the Odyssey learning platform, the perfect place to start your GraphQL journey with videos and interactive code challenges. Join the Apollo Community to interact with and get technical help from the GraphQL community.