It allows you to execute queries and mutations against a GraphQL server, and returns results as query-specific Swift types. This means you don’t have to deal with parsing JSON, or passing around dictionaries 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 UI uses.
As the generated types are query-specific, you're only able to access data you actually specify as part of a query. If you don't ask for a field, you won't be able to access the corresponding property. In effect, this means you can now rely on the Swift type checker to make sure errors in data access show up at compile time. With our Xcode integration, you can conveniently work with your UI code and corresponding GraphQL definitions side by side, and it will even validate your query documents, and show errors inline.
Apollo iOS does more than simply run your queries against a GraphQL server: It normalizes query results to construct a client-side cache of your data, which is kept up to date as further queries and mutations are run. This means your UI is always internally consistent, and can be kept fully up-to-date with the state on the server with the minimum number of queries required.
This combination of models with value semantics, one way data flow, and automatic consistency management, leads to a very powerful and elegant programming model that allows you to eliminate common glue code and greatly simplifies app development.
If you are new to Apollo iOS we recommend our Getting Started guide.
There is also comprehensive documentation including an API reference.
All releases are catalogued and we maintain a changelog which details all changes to the library.
The roadmap is a high-level document that describes the next major steps or milestones for this project. We are always open to feature requests, and contributions from the community.
This project is being developed using Xcode 14 and Swift 5.7.
If you open Apollo.xcodeproj
, you should be able to run the tests of the Apollo
, ApolloSQLite
, and ApolloWebSocket
frameworks on your Mac or an iOS Simulator. ApolloCodegenLib
tests can only be run on macOS.
Some of the tests run against a simple GraphQL server serving the Star Wars example schema (see installation instructions there).
If you'd like to contribute, please refer to the Apollo Contributor Guide.
Apollo builds open-source software and a graph platform to unify GraphQL across your apps and services. We help you ship faster with:
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.
link |
Stars: 3582 |
Last commit: 8 hours ago |
graphQLSchema
in scope (#2705): Generated fragments now use the correct schema namespace casing. #2730 - Thank you to @iAmericanBoy for raising the issue.ApolloAPI.JSONDecodingError.missingValue
error (#2697): Cache mutations will now allow incomplete data to be written to the cache without expecting all fields to be set. Please note that cache manipulation is an advanced feature and you should be aware of how the data written will affect network requests and cache policies. #2751 - Thank you to @amseddi for raising the issue.GraphQLEnum
value camel case conversion strategy (#2640), (#2749): The camel case conversion logic for GraphQL enums has been improved to handle a wider range of edge cases that were causing invalid Swift code generation. #2745 - Thank you to @ddanielczyk and @hispanico94 for raising the issues.Selection
type from apollo (#2708): ParentType
and Selection
types in generated selection sets now use a fully qualified namespace to prevent typename conflicts. #2754 - Thank you to @tahirmt for raising the issue.schemaName
(#2664): Certain strings are now disallowed for use as the schema namespace. #2755 - Thank you to @StarLard for raising the issue.DocumentType
in generated mock code (#2719): All shared referenced schema types within test mocks now use a fully qualified named type. #2762 - Thank you to @dafurman for raising the issue.Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics