Releases: apollographql/apollo-ios
1.3.1
Fixed
- Fix crashes in test mocks when setting an array of union types (#3023): See PR (#3089). Thank you to @jabeattie & @scottasoutherland for raising the issue.
Deprecated
- Deprecated
APQConfig
&operationIdentifiersPath
inApolloCodegenConfiguration
.- These have been replaced with
OperationDocumentFormat
andOperationManifestFileOutput
respectively. Please see the documentation forApolloCodegenConfiguration
for more information.
- These have been replaced with
1.3.0
Though 1.3.0
is a minor version bump, some critical issues were addressed in this version that requires a small breaking change during the upgrade. While we strive to make the upgrade path for minor versions seamless, these issues could not be reasonably resolved without requiring this migration.
For a detailed explanation of the breaking changes and a guide on how to migrate to 1.3.0
, see our migration guide.
Breaking
1.2.2
Added
- Support SOCKS proxies for debugging websocket based subscriptions(#2788): Thank you to @tahirmit for the contribution.
Fixed
- Fix conversion of generated models into nested type cases (#2989 & #2980): In some cases, the generated models were missing types when calculating which fragments were fulfilled for a selection set. This was causing type case conversion to return
nil
incorrectly. See PR #3067. Thank you to @tgyhlsb and @dafurman for raising these issues. - Fix crashes in code generation when merging fragments at definition root (#3071): When fragments with type conditions were defined on the root of an operation or named fragment, the code generation engine was crashing. See PR #3073. Thank you to @tahirmit for raising and helping us reproduce this issue.
- Fix parsing of input objects as default values for input params (#2978): The codegen engine will no longer crash in this situation. Thank you to @ecunha-ta for raising the issue.
1.2.1
1.2.0
Though 1.2 is a minor version bump, a critical problem was addressed in this version that requires a small breaking change during the upgrade. While we strive to make the upgrade path for minor versions seamless, this issue could not be reasonably resolved without requiring this migration.
For most users, this migration will only require a single change to your SchemaConfiguration.swift
file.
For a detailed explanation of the breaking changes and a guide on how to migrate to v1.2, see our migration guide.
Breaking
- Cache Key Configuration API Changes (#2990): The API for configuring custom cache keys has had a minor change in this version. The signature of the
cacheKeyInfo(for:object:)
function, defined in your generated SchemaConfiguration.swift file, has been modified. For more information, see our migration guide.
Improved
- Improved performance of GraphQL execution (#2990): Improvements to the
GraphQLExecutor
resulted in a ~15-20% reduction in execution time for parsing and mapping network response or cache data onto generated models. - Improved performance of generated model initialization and type conversions (#2990): The
DataDict
used to store the data for generated models has been updated to use copy-on-write value semantics. This resulted in a ~70-80% reduction in the execution time of initialization and type case conversions in the generated models.
Fixed
- Pruning generated files for
.relative(subpath:)
operations (#2969): See PR #2994. Thank you to @jimisaacs for raising the issue. - InputObjects generated with incorrect getter/setter key (#2858): See PR #2996. Thank you to @Austinpayne for raising the issue.
- Generates conflicting types for fields of singular and plural names (#2850): See PR #3009. Thank you to @sgade for raising the issue.
- Equality operator shows incorrect values based on value of
__fulfilled
(#2944): See PR #2990. Thank you to @scottasoutherland for raising the issue.
New
- Add option to generate objects with
internal
access modifier (#2630): See PR #2917. Thank you to @simonbilskyrollins for the feature request.
1.1.3
Fixed
@dynamicMember
conflicting field name (#2950): The subscript setters have been changed to allow a selection set property namedhash
. #2965 Thank you to @renanbdias for raising the issue.- Disallow certain targetNames in code generation (#2958):
apollo
is no longer allowed as a target name otherwise it causes a conflict when importingApollo
as a module. #2972 Thank you to @moopoints for raising the issue. - Fully Qualify name of RootEntityType and mergedSources (#2949): Selection set types use fully qualified namespacing to prevent conflicts with other types. #2956 Thank you to @martin-muller for raising the issue.
- SelectionSet Codegen
__typename
fix (#2955): Custom root types defined in the schema are now correctly applied to selection set fields typename definitions #2983 Thank you to @ynnadrules for raising the issue.
1.1.2
Fixed
- Crash after calling
cancel()
onCancellable
(#2932): Callingcancel()
on a non-subscriptionCancellable
will now correctly handle the lifetime of the internallyUnmanaged
object. #2943 - Thank you to @yonaskolb for raising the issue. - Deprecation messages are not escaped (#2879): If escaped characters are used in GraphQL deprecation messages they are now properly escaped in the rendered Swift warning or attribution message. #2951 Thank you to @djavan-bertrand for raising the issue.
Added
- Add injecting additionalErrorHandler for upload operations to RequestChainNetworkTransport (#2948):
Upload
operations can now have custom error interceptors like other operations. #2948 Thank you to @RobertDresler for the contribution.
1.1.1
Fixed
- Version 1.1.0 does not compile when installed via CocoaPods (#2936): Module names not present in CocoaPods builds have been removed from type declarations. #2937 - Thank you to @simonliotier for raising the issue.
- Crash when using mocks for Double Nested Arrays (#2809): Test mock data is now correctly applied to the selection set. #2939 - Thank you to @scottasoutherland for raising the issue.
- In 1.1.0, passing custom scalars or GraphQLEnum to mocks fails (#2928): Test mock data is now correctly applied to the selection set. #2939 - Thank you to @scottasoutherland for raising the issue.
1.1.0
Apollo iOS v1.1 primarily focuses on adding generated initializers to the generated operation models.
In most cases, the upgrade from v1.0 to v1.1 should require no changes to your code.
Breaking
- Changed generated fragment accessors with inclusion conditions: When conditionally spreading a fragment with an
@include/@skip
directive that has a different parent type than the selection set it is being spread into, the shape of the generated models has changed.- For example, a fragment accessor defined as
... on DetailNode @include(if: $includeDetails)
would have previously been namedasDetailNode
; it will now be generated asasDetailNodeIfIncludeDetails
.
- For example, a fragment accessor defined as
- While no breaking changes were made to official public APIs, some underscore prefixed APIs that are
public
but intended for internal usage only have been changed.- SelectionSet fulfilled fragment tracking:
SelectionSet
models now keep track of which fragments were fulfilled during GraphQL execution in order to enable conversions between type cases. While this does not cause functional changes while using public APIs, this is a fundamental change to the way that the underlying data for aSelectionSet
is formatted, it is now required that allSelectionSet
creation must be processed by theGraphQLExecutor
or a generated initializer that is guaranteed to correctly format the data. This means that initializing aSelectionSet
using raw JSON data directly will no longer work. Please ensure that raw JSON data is only used with the newRootSelectionSet.init(data: variables)
initializer.
- SelectionSet fulfilled fragment tracking:
Fixed
- Null/nil value parsing issues. In some situations, writing/reading
null
ornil
values to the cache was causing crashes in 1.1 Beta 1. This is now fixed.
Added
- Configuration option for generating initializers on SelectionSet models: You can now get initializers for your generated selection set models by setting the
selectionSetInitializers
option on your code generation configuration. Manually initialized selection sets can be used for a number of purposes, including:- Adding custom data to the normalized cache
- Setting up fixture data for SwiftUI previews or loading states
- An alternative to Test Mocks for unit testing
- Safe initialization of
SelectionSet
models with raw JSON: In 1.0, initializingSelectionSet
models with raw JSON was unsafe and required usage of underscore prefixed APIs that were intended for internal usage only. Apollo iOS 1.1 introduces a new, safe initializer:RootSelectionSet.init(data: variables)
.- Previously, if you provided invalid JSON, your selection set's were unsafe and may cause crashes when used. The new initializer runs a lightweight version of GraphQL execution over the provided JSON data. This quickly parses, validates, and transforms the JSON data into the format required by the
SelectionSet
models. If the provided data is invalid, this initializerthrows
an error, ensuring that your model usage is always safe.
- Previously, if you provided invalid JSON, your selection set's were unsafe and may cause crashes when used. The new initializer runs a lightweight version of GraphQL execution over the provided JSON data. This quickly parses, validates, and transforms the JSON data into the format required by the
- Added support for multipart subscriptions over HTTP.
Changed
- Generate
__typename
selection for generated models: In 1.1, the code generator adds the__typename
field to each root object. In previous versions, this selection was automatically inferred by theGraphQLExecutor
, however generating it directly should improve performance of GraphQL execution.
1.1.0 Beta #1
This is the first Beta Release of Apollo iOS 1.1. Version 1.1 primarily focuses on adding generated initializers to the generated operation models.
While no breaking changes were made to official public APIs, some underscore prefixed APIs that are public
but intended for internal usage only have been changed.
Added
- Configuration option for generating initializers on SelectionSet models: You can now get initializers for your generated selection set models by setting the
selectionSetInitializers
option on your code generation configuration. Manually initialized selection sets can be used for a number of purposes, including:- Adding custom data to the normalized cache
- Setting up fixture data for SwiftUI previews or loading states
- An alternative to Test Mocks for unit testing
- Safe initialization of
SelectionSet
models with raw JSON: In 1.0, initializingSelectionSet
models with raw JSON was unsafe and required usage of underscore prefixed APIs that were intended for internal usage only. Apollo iOS 1.1 introduces a new, safe initializer:RootSelectionSet.init(data: variables)
.- Previously, if you provided invalid JSON, your selection set's were unsafe and may cause crashes when used. The new initializer runs a lightweight version of GraphQL execution over the provided JSON data. This quickly parses, validates, and transforms the JSON data into the format required by the
SelectionSet
models. If the provided data is invalid, this initializerthrows
an error, ensuring that your model usage is always safe.
- Previously, if you provided invalid JSON, your selection set's were unsafe and may cause crashes when used. The new initializer runs a lightweight version of GraphQL execution over the provided JSON data. This quickly parses, validates, and transforms the JSON data into the format required by the
- Added support for multipart subscriptions over HTTP.
Changed
- SelectionSet fulfilled fragment tracking:
SelectionSet
models now keep track of which fragments were fulfilled during GraphQL execution in order to enable conversions between type cases. While this does not cause functional changes while using public APIs, this is a fundamental change to the way that the underlying data for aSelectionSet
is formatted, it is now required that allSelectionSet
creation must be processed by theGraphQLExecutor
or a generated initializer that is guaranteed to correctly format the data. This means that initializing aSelectionSet
using raw JSON data directly will no longer work. Please ensure that raw JSON data is only used with the newRootSelectionSet.init(data: variables)
initializer. - Generate
__typename
selection for generated models: In 1.1, the code generator adds the__typename
field to each root object. In previous versions, this selection was automatically inferred by theGraphQLExecutor
, however generating it directly should improve performance of GraphQL execution. - Changed generated fragment accessors with inclusion conditions: When conditionally spreading a fragment with an
@include/@skip
directive that has a different parent type than the selection set it is being spread into, the shape of the generated models has changed. This does not affect generated call sites, but only affects the generatedselection
metadata used internally by theGraphQLExecutor
.