Releases: apollographql/apollo-ios
1.0.0 Release Candidate #1
This is the first Release Candidate for Apollo iOS 1.0. The Release Candidate is a fully featured and code-complete representation of the final 1.0 version. This includes full feature parity with the 0.x.x releases.
API breaking changes are not expected between the Release Candidate and the General Availability (GA) release. The only code changes will be non-breaking bug fixes due to user feedback. The Release Candidate does not have complete documentation or usage guides, which will be completed prior to GA.
This first major version will include a new code generation engine, better generated models, and many syntax and performance improvements across the entire library. The primary goal of Apollo iOS 1.0 is to stabilize the API of the model layer and provide a foundation for future feature additions and evolution of the library.
- New: Option to Include Deprecated Input Arguments on Fields During Schema Download Thanks to @dave-perry for this addition!
- Fixed: Code Generation Config JSON File Compatibility
- Previously, the
apollo-codegen-config.json
file used by the Apollo CLI needed to contain values for all optional fields. When new codegen options were added, this would cause errors until all newly added options has values provided. - The
Codable
implementation for theApolloCodgenConfiguration
has been implemented manually to prevent this. Now, only required fields must be provided, all optional fields can be omitted from the config file safely. - The CLI's
init
command also now generates a template config file with only the required fields.
- Previously, the
- Fixed: Swift Keywords are escaped when used as names of Input Parameters
- Fixed: Compilation Error when using
@skip
and@include
conditions on the same field - Fixed: Added permissions request to SPM Code Generation Plugin
- When running the code generation plugin, you will be prompted to give permission for the plugin to write to the package directory.
- This permission check can be avoided by passing the
--allow-writing-to-package-directory
flag when executing the plugin command.
- Fixed: APQ Operations Will no Longer be Retried when Unrecognized if using
.persistedOperationsOnly
.persistedOperationsOnly
is for use with allow-listed operations only. If an operation identifier is not recognized by the server, there is no way to register the operation in this configuration.
- Breaking: Updated
ApolloAPI
internal metadata properties to be__
prefixed.- Generated GraphQL files expose certain properties/functions that are consumed by the
Apollo
library during GraphQL Execution. These members must be public in order to be exposed toApollo
, but are not intended for external consumption. We have added underscore prefixes to each of these members to signify that intention, using__
for GraphQL Metadata (in alignment with the GraphQL Specification) and_
forApollo
's utility and helper functions. - The affected signatures are:
SelectionSet.schema
->SelectionSet.__schema
SelectionSet.selection
->SelectionSet.__selection
JSONEncodable.jsonValue
->JSONEncodable._jsonValue
JSONDecodable.init(jsonValue:)
->JSONDecodable.init(_jsonValue:)
AnyHashableConvertible.asAnyHashable
->AnyHashableConvertible._asAnyHashable
OutputTypeConvertible.asOutputType
->OutputTypeConvertible._asOutputType
GraphQLOperation.variables
->GraphQLOperation._variables
LocalCacheMutation.variables
->LocalCacheMutation._variables
- Generated GraphQL files expose certain properties/functions that are consumed by the
1.0.0 Beta 4
This is the fourth Beta Release of Apollo iOS 1.0. The Beta version has full feature parity with the 0.x.x releases. The API is expected to be mostly stable. Some breaking changes may occur due to user feedback prior to General Availability (GA) Release. The Beta does not have complete documentation or usage guides, which will be completed prior to GA.
This first major version will include a new code generation engine, better generated models, and many syntax and performance improvements across the entire library. The primary goal of Apollo iOS 1.0 is to stabilize the API of the model layer and provide a foundation for future feature additions and evolution of the library.
- Breaking: Generated Files now have the file extension
.graphql.swift
.- This allows you to clearly distinguish which files in your project are Apollo generated files.
- Generated template files that are user-editable will still have the
.swift
file extension.CustomScalar
templates as well as theSchemaConfiguration
file are user-editable. Once these are generated, they are never overwritten by future code generation execution.
- This change is also necessary for the identification of generated files for the pruning functionality.
- New: Pruning of Unused Generated Files
- Generated files that no longer should exist are automatically deleted now. This occurs when a
.graphql
file is removed from your project. The generated file will also be deleted the next time code generation is run. - This can be disabled with the new
pruneGeneratedFiles
codegen option. - Breaking: Automatic Deletion will not delete files generated in previous Alpha/Beta versions.
- Only files with the
.graphql.swift
file extension will be deleted. - If you have used previous Alpha/Beta versions, you will need to delete your generated files manually one last time before running code generation with this version.
- Only files with the
- Generated files that no longer should exist are automatically deleted now. This occurs when a
- New: Enum Case Names are Converted to Camel Case in Generated Enums.
- Breaking: This is enabled by default, your call sites will need to be updated.
- Camel case conversion for enum cases can be disabled with the new
conversionStrategies.enumCases
codegen option. - Thanks @bannzai for this one!
- Fixed: Swift Keywords are escaped when used as names of Enum Values Thanks @bannzai for the fix!
- Fixed: Compilation Error when Using Fragment with Lowercased Name This was an edge case that only occured when referencing a nested, merged selection set from the lowercase named fragment.
- Fixed: Retain Cycle in
ReadTransaction
Thanks @lorraine-hatch for the fix! - Fixed: String
jsonValue
Initializer for Large Numbers Thanks @Almaz5200 for the fix!
1.0.0 Beta 3
This is the third Beta Release of Apollo iOS 1.0. The Beta version has full feature parity with the 0.x.x releases. The API is expected to be mostly stable. Some breaking changes may occur due to user feedback prior to General Availability (GA) Release. The Beta does not have complete documentation or usage guides, which will be completed prior to GA.
This first major version will include a new code generation engine, better generated models, and many syntax and performance improvements across the entire library. The primary goal of Apollo iOS 1.0 is to stabilize the API of the model layer and provide a foundation for future feature additions and evolution of the library.
- Breaking: Changed the generated Schema files
- The schema will now have two generated files,
SchemaMetadata.swift
andSchemaConfiguration.swift.
- We wanted to more clearly separate the parts of the schema that are generated for you (metadata) from the parts that you can configure yourself (configuration).
- *If you were using the last beta, you鈥檒l need to move your cache key resolution logic into
SchemaConfiguration.swift
. You should also delete the old generated files. - We will be implementing automatic deletion of generated files that should no longer be part of your project in a future beta, so you won't need to delete those files manually anymore.
- The schema will now have two generated files,
- New: Added SPM Plugin for Code Generation CLI
- When including Apollo iOS via Swift Package Manager, the Code Generation CLI is now accessible as an SPM Plugin.
- After installing the
apollo-ios
package, runswift package --disable-sandbox apollo-initialize-codegen-config
to create the codegen configuration file. - Then you can run
swift package --disable-sandbox apollo-generate
to run code generation. - The
--disable-sandbox
or--allow-writing-to-directory .
arguments must be used when running the Code Generation CLI via the SPM plugin to give the plugin permission to write the generated files to the output directory configured in your codegen configuration file.
- Fixed: Compilation errors when schema types had lowercase names
- Fixed: Codegen engine crashing in specific situations
- There were some bugs in the codegen compiler when merging nested fragments with non-matching parent types and using default values for input object list fields.
- Fixed: Issues with websocket reconnections Thanks @STomperi for the fix!
1.0.0 Beta 2
This is the second Beta Release of Apollo iOS 1.0. The Beta version has full feature parity with the 0.x.x releases. The API is expected to be mostly stable. Some breaking changes may occur due to user feedback prior to General Availability (GA) Release. The Beta does not have complete documentation or usage guides, which will be completed prior to GA.
This first major version will include a new code generation engine, better generated models, and many syntax and performance improvements across the entire library. The primary goal of Apollo iOS 1.0 is to stabilize the API of the model layer and provide a foundation for future feature additions and evolution of the library.
- Breaking: Changed API for Cache Key Configuration: Cache Key Resolution is now easier to configure. See
CacheKeyInfo
for examples and documentation. - Breaking: Changed API for generated Schema Types to support dynamic types The API for generated schema types now initializes instances of
Object
,Interface
, andUnion
for each corresponding type in your schema. These are still generated by the code generation engine. This differs from the previous API which generated static types that were subclasses ofObject
,Interface
, andUnion
. The change provides the API to support the future addition of dynamic types added to your schema at runtime. - New: Codegen CLI will now automatically create output directories: You no longer are required to have already created all intermediary directories for your codegen output paths prior to running code generation.
- New: CodegenCLI is built locally with CocoaPods installations: This is to ensure that the version of the Codegen CLI is the same as ApolloCodegenLib. This behavior will be extended to Swift Package Manager installations too.
- New: Swift Keywords are escaped when used as names of fields or types in generated objects: Previously, using Swift keywords (eg.
self
,protocol
,Type
) as the names of fields in your operations or types in your schema would cause compilation errors in your generated code. Now, these names will be escaped with backticks to prevent compiler errors. The names__data
andfragments
cannot be used as field names as they conflict with Apollo's generated object APIs Using these names will result in a validation error being thrown when attempting to run the code generation engine. - Fixed: Fragments with lowercase names caused compilation errors: This bug is fixed. Fragments with lowercase names will be correctly uppercased when referencing the generated
Fragment
objects. - Fixed: Build errors in Xcode 14/Swift 5.7: The library was updated to support the Swift 5.7 language version. Swift 5.6 is still supported.
- Fixed: Xcode 14 does not support Bitcode: Starting with Xcode 14, bitcode is no longer required for watchOS and tvOS applications, and the App Store no longer accepts bitcode submissions from Xcode 14.
- Fixed: "No such module
ApolloAPI
" error when using CocoaPods: The podspec was not configured to import all required source files and some import statements were unnecessary in a CocoaPods environment. A code generation configuration option was added to order to ensure generated files are generated with the correct import statements in a CocoaPods environment. When generating code for a project that includesApollo
via Cocoapods, you must set thecocoapodsCompatibleImportStatements
option totrue
in yourApolloCodegenConfiguration
. When using the Codegen CLI that is built for you duringpod install
theapollo-ios-cli init
command will default this option totrue
. When building the Codegen CLI in by other method, this option will default tofalse
. - Removed: ApolloUtils target no longer necessary: The things that used to be shared here are actually no longer shared. There is no code shared between the
Apollo
andApolloCodegenLib
targets. - Removed: ApolloCodegenConfiguration.validation: This method was incorrectly requiring destination paths to exist before code generation. Once that was removed it was no longer necessary. Any errors that are encountered with destination output paths will be raised during code generation.
Release 0.53.0
- Remove all instances of bitcode as not supported in Xcode 14: Starting with Xcode 14, bitcode is no longer required for watchOS and tvOS applications, and the App Store no longer accepts bitcode submissions from Xcode 14. #2398 - Thanks to @stareque-atlassian for the contribution!
Version 0.52.0
- Add codegen option for excludes: There is a new property on the codegen configuration options to allow files matching the pattern to be excluded, in the case they are found in the
includes
path. #2205 - Thanks to @bannzai for the contribution! - Fixed - Using the
graphql_transport_ws
protocol could result in4400
errors from the server: The correct protocol message is now being sent to the server to end communication. #2320 - Replace
print
statement withCodegenLogger.log
: All codegen output is logged withCodegenLogger
which can be disabled if needed. #2348 - Thanks to @hiltonc for the contribution! - Expose
GraphQLResultError
path string: Adds a new publicly available computed property toGraphQLResultError
which just exposes thepath
description. #2361 - Thanks to @joshuashroyer-toast for the contribution!
1.0.0 Beta 1
This is the first Beta Release of Apollo iOS 1.0. The Beta version has full feature parity with the 0.x.x releases. The API is expected to be mostly stable. Some breaking changes may occur due to user feedback prior to General Availability (GA) Release. The Beta does not have complete documentation or usage guides, which will be completed prior to GA.
This first major version will include a new code generation engine, better generated models, and many syntax and performance improvements across the entire library. The primary goal of Apollo iOS 1.0 is to stabilize the API of the model layer and provide a foundation for future feature additions and evolution of the library.
- New: Additional Generated Code Output Configuration Options.
queryStringLiteralFormat
: Configures how the generated operations render the operation document source. Either multi-line (as defined in operation definition) or minified to a single line.schemaDocumentation
: Documentation of fields and objects from your schema will now be included as in-line documentation on generated objects. This can be disabled by settingschemaDocumentation
to.excluded
in your codegen configuration.warningsOnDeprecatedUsage
: Adds warning annotation when using fields and arguments in generated operations that are deprecated by the schema.additionalInflectionRules
: Allows you to configure custom singularization rules for generated fields names.
- New: Support Automatic Persisted Queries: APQs are now fully functional. Note: Legacy operation safelisting support may experience issues in some cases. If you have problems using operation safelisting, please create an issue so that we may understand and resolve the edge cases in the safelisting process.
- Fixed: Singularization of plural names for non-list fields.
- Fixed: Runtime failure on execution of operations with InputObjects.
- Fixed:
__typename
field no longer generated when manually included:__typename
is automatically included in all operations and fragments and has a default property on all Selection Sets. Generating the field was redundant and caused compilation errors.
1.0.0 Alpha 8
This is the eighth Alpha Release of Apollo iOS 1.0. This first major version will include a new code generation engine, better generated models, and many syntax and performance improvements across the entire library. The primary goal of Apollo iOS 1.0 is to stabilize the API of the model layer and provide a foundation for future feature additions and evolution of the library.
- New: Added
Equatable
andHashable
Conformance to public API Models: Object's likeGraphQLRequest
andGraphQLError
now can be compared! - New: Code Generation now supports Schema Extensions.
- Fixed: Namespacing and Access Control on Generated Models: Generated models were failing to compile due to namespacing and access control issues in certain code generation configurations. This is fixed now!
- Improved: Custom Scalar Default Float Behavior: If the response for a custom scalar is provided as a
Float
, it will automatically be converetd to aString
(just like it's always done forInt
). - Improved: GraphQL Float now treated as Swift Double: The
Float
defined in the GraphQL spec is actually compliant with a SwiftDouble
. Generated code will now generate Swift code with fields of typeDouble
for GraphQLFloat
. - Improved: Rename
SelectionSet.data
toSelectionSet.__data
: This is to prevent naming conflicts with GraphQL fields nameddata
. - Fixed:
graphql_transport_ws
protocol now sends 'complete' to end subscription: The protocol implementation was previously sending the wrong message to close the connection. - Improved: Generated Operations Folder Structure: The generated output folder structure for fragments and operations are now organized into sub-folders.
- New: Introspection Schema Download can output JSON: Schema downloads via Introspection now support output as JSON instead of only SDL. Note that Apollo Registry schema downloads still only support SDL as the output.
1.0.0 Alpha 7
This is the seventh Alpha Release of Apollo iOS 1.0. This first major version will include a new code generation engine, better generated models, and many syntax and performance improvements across the entire library. The primary goal of Apollo iOS 1.0 is to stabilize the API of the model layer and provide a foundation for future feature additions and evolution of the library.
- New: Local Cache Mutations are now supported: In order to perform a local cache mutation, define a
.graphql
file with an operation or a fragment and mark it with the directive@apollo_client_ios_localCacheMutation
. This will ensure the code generator generates a mutable cache mutation operation.- Note: Local Cache Mutation operations cannot be used for fetching from the network! You should define separate GraphQL operations for network operations and local cache mutations.
- Example Usage:
/// SampleLocalCacheMutation.graphql
query SampleLocalCacheMutation @apollo_client_ios_localCacheMutation {
allAnimals {
species
skinCovering
... on Bird {
wingspan
}
}
}
/// SampleLocalCacheMutationFragment.graphql
fragment SampleLocalCacheMutationFragment on Pet @apollo_client_ios_localCacheMutation {
owner {
firstName
}
}
- New: Support Code Generation Configuration Option:
deprecatedEnumCases
: IfdeprecatedEnumCases
is set toexclude
, deprecated cases in graphql enums from your schema will not be generated and will be treated as unknown enum values. - Fixed - Compilation Errors in Generated Code When Schema was Embedded In Target: When embedding the generated schema in your own target, rather than generating a separate module for it, there were compilation errors due to access control and namespacing issues. These are resolved. This fixes #2301 & #2302. Thanks @kimdv for calling attention to these bugs!
- Note: Compilation Errors for Test Mocks are still present. We are aware of ongoing issues with generated test mocks. We are actively working on fixing these issues and they will be resolved in a future alpha release soon.
- Fixed: Crash When Accessing a Conditionally Included Fragment That is Nil. This is fixed now and will return
nil
as it should. This fixes #2310.
1.0.0 Alpha 6
This is the sixth Alpha Release of Apollo iOS 1.0. This first major version will include a new code generation engine, better generated models, and many syntax and performance improvements across the entire library. The primary goal of Apollo iOS 1.0 is to stabilize the API of the model layer and provide a foundation for future feature additions and evolution of the library.
- New - Objects and InputObjects are now equatable: Many objects now conform to
AnyHashable
bringing with them the ability to conform toEquatable
, this should make tests easier to write. - Change - GraphQLOperation fields are now static: Previously an instance of a
GraphQLOperation
was required to query any of it's properties, you can do that on the type now. - Fixed - Nested fragment type cases: Nested fragment type cases were not being generated causing a crash in selection set generation.
- New - Code generation now has a CLI: A new command line executable has been built and will be available on Homebrew very soon! Check it out here.
- Fixed - SelectionSet and InlineFragment protocol definitions: These were incorrectly being generated within the namespace when a module of type
.embeddedInTarget
was being used. - Fixed - Test mock convenience initializers: These were incorrectly defining parameter types for
Interface
andUnion
fields and the generated package could not successfully build.