Changelog History
Page 1
-
v1.0.5 Changes
๐ Fixed
- ๐ Fixed - Missing SPM plug-in: The missing Swift Package product has been added and the
Install CLI
plug-in is now available from the SPM command line and the Xcode project menu. #2683
- ๐ Fixed - Missing SPM plug-in: The missing Swift Package product has been added and the
-
v1.0.4 Changes
๐ Fixed
- ๐ Fixed - Convenience initializer for mock objects without fields: When mock objects did not have any fields a convenience initializer would still be generated causing infinite recursion during initialization. #2634 Thank you to @Gois for the contribution!
- ๐ Fixed - Ambiguous use of operator '??': When the nil coalescing operator was used on variables without a type the compiler could not determine which one to use. #2650. Thanks to @skreberem for raising the issue.
- ๐ Fixed - Generate library for test mock target: Previous versions would generate the SPM target for test mocks but not a library to properly import it into your unit tests. #2638 Thank you to @Gois for the contribution!
- ๐ Fixed - Podspec Swift version mismatched with SPM package version: The Swift version is now the same between the two dependency managers. #2657
- ๐ Fixed - Conflicting configuration values: There is now an error during code generation when the given configuration has conflicting values that cannot be fulfilled. #2677
- ๐ Fixed -
DocumentType
namespacing: The correct module namespacing is now used forDocumentType
in generated operation code. #2679
๐ New
- ๐ New - CLI version checker: This ensures that the version of the CLI being used to generate Swift code is the same as the version of the Apollo iOS dependency being used. #2562
๐ Changed
- ๐ Changed - Removed SPM plug-ins: The SPM plug-ins for the CLI commands
init
,fetch-schema
, andgenerate
have been removed. There is a new plug-in to install the CLI and the CLI commands should be used from the command line instead. #2649 - ๐ Changed - CLI defaults: The updated default for the output of operation files is now
.inSchemaModule
, and theinit
command now requires a module type to be specified when creating a configuration file. #2673
-
v1.0.3 Changes
- ๐ Fixed - Generated code produces compile error when accessing
data
dictionary in theInputDict
struct if the name of the accessed property ishash
: Dyanamic Member Lookup has been removed fromInputDict
to prevent potential name clashes. #2607 - ๐ Fixed - XCFramework archive builds:
@inlinable
has been removed from parts ofApolloAPI
that were preventing xcframework builds with theBUILD_LIBRARY_FOR_DISTRIBUTION
build setting. #2613 - ๐ Fixed -
Variables
type in local cache mutations is not properly namespaced: TheVariables
type inLocalCacheMutation
now has the required prefix ofGraphQLOperation
to build successfully. #2615 - ๐ Fixed - Return error if no matches to schema or operation search paths: When a schema file could not be found errors were emitted but they were not indicative of the underlying problem. There is now validation to ensure that at least one match of the schema/operation search paths is found otherwise an error is thrown. #2618
- ๐ Fixed - File generation should ignore the
.build
/.swiftpm
/.Pods
folders: If code generation was executed from a path where subfolders contained the apollo-ios repo, it would find internal test schemas and fail. These special folders are now ignored. #2628 - ๐ Fixed - Download schema relative to root URL: Even though a root URL could be provided it was not being used in all schema download logic to output the downloaded schema file to the correct locaiton. This is now fixed. #2609 Thanks to @Anteo95 for the contribution.
- ๐ Fixed - Generated code produces compile error when accessing
-
v1.0.2 Changes
- ๐ Fixed - Not generating code for subtypes only used as input to mutations: If you are using a JSON format schema that was fetched via GraphQL introspection code generation will now generate all referenced subtypes. #2583 Thank you to @vrutberg for reporting the issue.
- ๐ Fixed - When using the test mock, touching a
GraphQLEnum
property will cause a crash: JSON Encoding the mocks into theSelectionSet.DataDict
was causingCustomScalar
values to get encoded into their JSON values. The mock data is now converted into the correct format for theSelectionSet.DataDict
. #2584 Thank you to @asapo for reporting the issue. - ๐ Fixed - Add namespace for ApolloAPI types in generated code: The Apollo
DocumentType
enum is now correctly namespaced in generated code. #2585 Thank you to @matijakregarGH for reporting the issue. - ๐ Fixed - Problems with schema name in generated code:
- ๐ Fixed - Test mocks crash when touching array of objects: Test mock list of objects is now correctly converted into selection set data. #2591 Thank you to @konomae for reporting the issue.
- ๐ Fixed:
GraphQLNullable
nil coalescing: @exported import statements now ensure that the operator overload is imported when using the generated models. #2600 Thank you to bassrock for reporting the issue.
-
v1.0.1 Changes
- ๐ Fixed - apollo-ios-cli code generation on CocoaPods installation: All required resources for the CLI are now bundled correctly. This was an issue in CocoaPods installations where the
generate
command ofapollo-ios-cli
would result in a fatal error. #2548 Thank you to @ilockett for reporting the issue. - ๐ Fixed - Xcode integration for Swift Package Plugins: The SwiftPM plugins now support
XcodePluginContext
from Xcode 14 and accepts the additional command line options that Xcode sends. #2554 Thank you to @SilverTab for reporting the issue. - ๐ Fixed - Escaping input param names: Input parameter names recognized as reserved words are now escaped to prevent build errors. #2561 Thank you to @puls for the contribution.
- ๐ Fixed - Multiline deprecation messages: Deprecation messages that span multiple lines would previously result in build errors. #2579 Thank you to @TizianoCoroneo for the contribution.
- ๐ Changed - Warnings for deprecated enums: Deprecated enum cases are no longer annotated with the Swift
@available
attribute. They will now have comments indicating their deprecated status. #2579
- ๐ Fixed - apollo-ios-cli code generation on CocoaPods installation: All required resources for the CLI are now bundled correctly. This was an issue in CocoaPods installations where the
-
v1.0.0 Changes
๐ This is the first major version release of Apollo iOS! 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.
In a nutshell, v1.0.0 brings:
- A new code generation engine built entirely in Swift
- ๐ Improvements to the generated models
- ๐ Syntax and performance improvements across the entire library
๐ There is documentation and a blog post coming soon. Feel free to ask questions by either opening an issue on our GitHub repo, or joining the community.
๐ Thank you to all contributors who have helped us get to this first major release! โค๏ธ
-
v1.0.0-rc.1 Changes
๐ 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
-
v1.0.0-beta.4 Changes
๐ 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.
- 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!
- ๐ฅ Breaking: Generated Files now have the file extension
-
v1.0.0-beta.3 Changes
๐ 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โll 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!
- ๐ฅ Breaking: Changed the generated Schema files
-
v1.0.0-beta.2 Changes
๐ 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 ofObject
,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: Codegen CLI is built locally with CocoaPods installations: This is to ensure that the version of the Codegen CLI is the same as ApolloCodegenLib. This behaviour 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 generatedFragment
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 moduleApolloAPI
" 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 theApollo
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.