Skip to content

Commit

Permalink
Merge pull request #6 from PGATOUR/update-apollo-xcode-16
Browse files Browse the repository at this point in the history
TDA-3865: Update to Support Xcode 16
  • Loading branch information
jasontduong committed Sep 18, 2024
2 parents c506b0f + 761e2d5 commit 3ae7724
Show file tree
Hide file tree
Showing 88 changed files with 2,105 additions and 713 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/prometheus-project-add.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Add to project
uses: actions/[email protected].0
uses: actions/[email protected].2
with:
project-url: https://github.com/orgs/apollographql/projects/21
github-token: ${{ secrets.PROMETHEUS_PROJECT_ACCESS_SECRET }}
Expand Down
3 changes: 2 additions & 1 deletion Apollo.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ Pod::Spec.new do |s|
s.osx.deployment_target = '10.14'
s.tvos.deployment_target = '12.0'
s.watchos.deployment_target = '5.0'
s.visionos.deployment_target = '1.0'

cli_binary_name = 'apollo-ios-cli'
s.preserve_paths = [cli_binary_name]
Expand All @@ -30,7 +31,7 @@ Pod::Spec.new do |s|
s.subspec 'SQLite' do |ss|
ss.source_files = 'Sources/ApolloSQLite/*.swift'
ss.dependency 'Apollo/Core'
ss.dependency 'SQLite.swift', '~>0.13.1'
ss.dependency 'SQLite.swift', '~>0.15.1'
ss.resource_bundles = {
'ApolloSQLite' => ['Sources/ApolloSQLite/Resources/PrivacyInfo.xcprivacy']
}
Expand Down
1 change: 1 addition & 0 deletions ApolloTestSupport.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ Pod::Spec.new do |s|
s.osx.deployment_target = '10.14'
s.tvos.deployment_target = '12.0'
s.watchos.deployment_target = '5.0'
s.visionos.deployment_target = '1.0'

s.source_files = 'Sources/ApolloTestSupport/*.swift'
s.dependency 'Apollo', '= ' + version
Expand Down
92 changes: 92 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,97 @@
# Change Log

## v1.15.1

### Fixed
- **Fix decoding of deprecated `selectionSetInitializer` option `localCacheMutations` ([#467](https://github.com/apollographql/apollo-ios-dev/pull/467)):** This option was deprecated in `1.15.0`, and the removal of the code to parse the option resulted in a validation error when the deprecated option was present in the JSON code generation config file. This is now fixed so that the option is ignored but does not cause code generation to fail.
- **Disfavour deprecated watch function ([#469](https://github.com/apollographql/apollo-ios-dev/pull/469)):** A deprecated version of the `watch` function matched the overload of the current version if certain parameters were omitted. This caused an incorrect deprecation warning in this situation. We've fixed this by adding `@_disfavoredOverload` to the deprecated function signature.

## v1.15.0

### New
- **Add ability to disable fragment field merging ([#431](https://github.com/apollographql/apollo-ios-dev/pull/431)):** Added `ApolloCodegenConfiguration` option to allow for disabling fragment field merging on generated models. For more information on this feature see the notes [here](https://github.com/apollographql/apollo-ios/releases/tag/preview-field-merging.1).

### Fixed
- **Fix `legacyResponse` property not being set on `HTTPResponse` ([#456](https://github.com/apollographql/apollo-ios-dev/pull/456)):** When the `legacyResponse` property of `HTTPResponse` was deprecated setting the value was also removed; this was incorrect as it created a hidden breaking change for interceptors that might have been using the value.
- **Fix `ObjectData` type check ([#459](https://github.com/apollographql/apollo-ios-dev/pull/459)):** Fixed bool type check in `ObjectData`.
- **Fix `SelectionSetTemplate` scope comparison ([#460](https://github.com/apollographql/apollo-ios-dev/pull/460)):** Refactored the selection set template scope comparison to account for an edge case in merged sources.
- **Fix memory leak in DataLoader closure ([#457](https://github.com/apollographql/apollo-ios-dev/pull/457)):** Fixed a memory leak in the DataLoader closure in `ApolloStore` caused by implicit use of `self`. _Thank you to [@prabhuamol](https://github.com/prabhuamol) for finding and fixing this._

### Breaking
- **Bug Fix: Generated Selections Sets in Inclusion Condition Scope:** This fixes a bug when using @include/@skip where generated models that should have been generated inside of a conditional inline fragment were generated outside of the conditional scope. This may cause breaking changes for a small number of users. Those breaking changes are considered a bug fix since accessing the conditional inline fragments outside of the conditional scope could cause runtime crashes (if the conditions for their inclusion were not met). More information [here](https://github.com/apollographql/apollo-ios/releases/tag/preview-field-merging.1)

## v1.14.1

### New
- **Ability to set the journal mode on sqlite cache databases ([#3399](https://github.com/apollographql/apollo-ios/issues/3399)):** There is now a function to set the journal mode of the connected sqlite database and control how the journal file is stored and processed. See PR [#443](https://github.com/apollographql/apollo-ios-dev/pull/443). _Thanks to [@pixelmatrix](https://github.com/pixelmatrix) for the feature request._

### Fixed
- **Fix crash when `GraphQLError` is “too many validation errors”" ([#438](https://github.com/apollographql/apollo-ios-dev/pull/438)):** When a GraphQLError from the JS parsing step is a “Too many validation errors” error, there is no `source` in the error object. Codegen will now check for it to avoid this edge case crash.
- **Cache write interceptor should gracefully handle missing cache records ([#439](https://github.com/apollographql/apollo-ios-dev/pull/439)):** The work to support the `@defer` directive introduced a bug where the cache write interceptor would throw if no cache records were returned during response parsing. This is incorrect as there are no cache records in the case of an `errors` only GraphQL response.
- **Avoid using `fatalError` on `JSONEncodable` ([#128](https://github.com/apollographql/apollo-ios-dev/pull/128)):** The fatal error logic in `JSONEncodable` was replaced with a type constraint `where` clause. _Thank you to [@arnauddorgans](https://github.com/arnauddorgans) for the contribution._
- **Introspection-based schema download creates duplicate `@defer` directive definition ([#3417](https://github.com/apollographql/apollo-ios/issues/3417)):** The codegen engine can now correctly detect pre-existing `@defer` directive definitions in introspection sources and prevent the duplicate definition. See PR [#440](https://github.com/apollographql/apollo-ios-dev/pull/440). _Thanks to [@loganblevins](https://github.com/loganblevins) for reporting the issue._

## v1.14.0

### New
- **Experimental support for the `@defer` directive:** You can now use the `@defer` directive in your operations and code generation will generate models that support asynchronously receiving the deferred selection sets. There is a helpful property wrapper with a projected value to determine the state of the deferred selection set, and support for cache reads and writes. This feature is enabled by default but is considered [experimental](https://www.apollographql.com/docs/resources/product-launch-stages/#experimental-features). Please refer to the [documentation](https://www.apollographql.com/docs/ios/fetching/defer/) for further details.
- **Add `debugDescription` to `SelectionSet` ([#3374](https://github.com/apollographql/apollo-ios/issues/3374)):** This adds the ability to easily print code generated models to the Xcode debugger console. See PR [#412](https://github.com/apollographql/apollo-ios-dev/pull/412). _Thanks to [@raymondk-nf](https://github.com/raymondk-nf) for raising the issue._
- **Xcode 16 editor config files ([#3404](https://github.com/apollographql/apollo-ios/issues/3404)):** Xcode 16 introduced support for `.editorconfig` files that represent settings like spaces vs. tabs, how many spaces per tab, etc. We've added a `.editorconfig` file with the projects preferred settings, so that the editor will use them automatically. See PR [#419](https://github.com/apollographql/apollo-ios-dev/pull/419). _Thanks to [@TizianoCoroneo](https://github.com/TizianoCoroneo) for raising the issue._

### Fixed
- **Local cache mutation build error in Swift 6 ([#3398](https://github.com/apollographql/apollo-ios/issues/3398)):** Mutating a property of a fragment annotated with the `@apollo_client_ios_localCacheMutation` directive caused a compile time error in Xcode 16 with Swift 6. See PR [#417](https://github.com/apollographql/apollo-ios-dev/pull/417). _Thanks to [@martin-muller](https://github.com/martin-muller) for raising the issue._

## v1.13.0

### New
- **Added `ExistentialAny` requirement ([#379](https://github.com/apollographql/apollo-ios-dev/pull/379)):** This adds the `-enable-upcoming-feature ExistentialAny` to all targets to ensure compatibility with the upcoming Swift feature.
- **Schema type renaming ([#388](https://github.com/apollographql/apollo-ios-dev/pull/388)):** This adds the feature to allow customizing the names of schema types in Swift generated code.
- **JSONConverter helper ([#380](https://github.com/apollographql/apollo-ios-dev/pull/380)):** This adds a new helper class for handling JSON conversion of data including the ability to convert `SelectionSet` instances to JSON.

### Fixed
- **ApolloSQLite build error with Xcode 16 ([#386](https://github.com/apollographql/apollo-ios-dev/pull/386)):** This fixes a naming conflict with Foundation in iOS 18 and the SQLite library. _Thanks to [@rastersize](https://github.com/rastersize) for the contributon._

## v1.12.2

### Fixed
- **Rebuilt the CLI binary with the correct version number:** The CLI binary included in the `1.12.1` package was built with an incorrect version number causing a version mismatch when attempting to execute code generation.

## v1.12.1

### Fixed
- **Rebuilt the CLI binary:** The CLI binary included in the `1.12.0` package was built with inconsistent SDK versions resulting in the linker signing not working correctly.

## v1.12.0

### New
- **`ID` as a custom scalar ([#3379](https://github.com/apollographql/apollo-ios/issues/3379)):** This changes the generation of the built-in GraphQL `ID` scalar to be treated as a custom scalar that can be modified by the user. See PR [#363](https://github.com/apollographql/apollo-ios-dev/pull/363).

### Fixed
- **Adds visionOS deployment to ApolloTestSupport podspec ([#364](https://github.com/apollographql/apollo-ios-dev/pull/364)):** This adds the `visionOS` deployment target to the ApolloTestSupport podspec to match the other package managers.
- **Add `@_spi(Execution)` to executor for import in test mocks ([#362](https://github.com/apollographql/apollo-ios-dev/pull/362)):** This replaces the use of `@testable` in ApolloTestSupport with specific `@_spi` scopes. This resolves a few issues that have been reported where the Apollo module could not be built for testing in non-debug configurations.

## v1.11.0

### New

- **Added `refetchOnFailedUpdates` option to `GraphQLQueryWatcher` ([#347](https://github.com/apollographql/apollo-ios/pull/347)):** This allows you to configure the query watcher not to refetch it's query from the server when a cache read to update it's data fails.

### Fixed

- **Generated input objects have default `nil` value for parameters with a schema-defined default value ([#2997](https://github.com/apollographql/apollo-ios/issues/2997)):** When the schema defines a default value for an input parameter, you can now omit that parameter when initializing the input object and the default value will be used. This corrects feature parity with the Apollo Kotlin client. See PR [#358](https://github.com/apollographql/apollo-ios-dev/pull/358).

- **Fix namespacing error in `InterfaceTemplate` ([#3375](https://github.com/apollographql/apollo-ios/issues/3375)):** This fixes an issue where having a schema type named `Interface` caused compilation errors in generated code. See PR [#359](https://github.com/apollographql/apollo-ios-dev/pull/359).

## v1.10.0

### New

- **Added support for visionOS ([#3320](https://github.com/apollographql/apollo-ios/issues/3320)):** All the dependecies that Apollo iOS requires have been updated to add support for visionOS, so we can now add official support for visionOS too. See PR [#333](https://github.com/apollographql/apollo-ios-dev/pull/333).

### Improvement

- **Add Sendable conformance to some basic SchemaTypes:** This adds `Sendable` conformance to the some of the generated schema types. This does not mean that all of the generated code is safe to use yet with complete concurrency checking of Swift 5.10 but it gets us closer to that goal. See PR [#322](https://github.com/apollographql/apollo-ios-dev/pull/322). _Thanks to [@bdbergeron](https://github.com/bdbergeron) for the contributon._

## v1.9.3

### Fixed
Expand Down
Binary file modified CLI/apollo-ios-cli.tar.gz
Binary file not shown.
33 changes: 3 additions & 30 deletions Design/3093-graphql-defer.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public struct Fragments: FragmentContainer {
@Deferred public var deferredFragmentFoo: DeferredFragmentFoo?
}

public struct DeferredFragmentFoo: AnimalKingdomAPI.InlineFragment, ApolloAPI.Deferrable {
public struct DeferredFragmentFoo: AnimalKingdomAPI.InlineFragment {
}
```

Expand Down Expand Up @@ -147,36 +147,9 @@ In the preview release of `@defer`, operations with deferred fragments will **no

### Request header

If an operation can support an incremental delivery response it must add an `Accept` header to the HTTP request specifying the protocol version that can be parsed. An [example](https://github.com/apollographql/apollo-ios/blob/spike/defer/Sources/Apollo/RequestChainNetworkTransport.swift#L115) is HTTP subscription requests that include the `subscriptionSpec=1.0` specification. `@defer` would introduce another operation feature that would request an incremental delivery response.
If an operation can support an incremental delivery response it must add an `Accept` header to the HTTP request specifying the protocol version that can be parsed in the response. An [example](https://github.com/apollographql/apollo-ios/blob/spike/defer/Sources/Apollo/RequestChainNetworkTransport.swift#L115) is HTTP subscription requests that include the `subscriptionSpec=1.0` specification. `@defer` introduces another incremental delivery response protocol. The defer response specification supported at the time of development is `deferSpec=20220824`.

This should not be sent with all requests though so operations will need to be identifiable as having deferred fragments to signal inclusion of the request header.

```swift
// Sample code for RequestChainNetworkTransport
open func constructRequest<Operation: GraphQLOperation>(
for operation: Operation,
cachePolicy: CachePolicy,
contextIdentifier: UUID? = nil
) -> HTTPRequest<Operation> {
let request = ... // build request

if Operation.hasDeferredFragments {
request.addHeader(
name: "Accept",
value: "multipart/mixed;boundary=\"graphql\";deferSpec=20220824,application/json"
)
}

return request
}

// Sample of new property on GraphQLOperation
public protocol GraphQLOperation: AnyObject, Hashable {
// other properties not shown

static var hasDeferredFragments: Bool { get } // computed for each operation during codegen
}
```
All operations will have an `Accept` header specifying the supported incremental delivery response protocol; Subscription operations will have the `subscriptionSpec` protocol, Query and Mutation operations will have the `deferSpec` protocol in the `Accept` header.

### Response parsing

Expand Down
23 changes: 16 additions & 7 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
// swift-tools-version:5.9
//
// The swift-tools-version declares the minimum version of Swift required to build this package.
// Swift 5.9 is available from Xcode 15.0.


import PackageDescription

Expand All @@ -9,7 +12,8 @@ let package = Package(
.iOS(.v12),
.macOS(.v10_14),
.tvOS(.v12),
.watchOS(.v5)
.watchOS(.v5),
.visionOS(.v1),
],
products: [
.library(name: "ApolloPGATOUR", targets: ["ApolloPGATOUR"]),
Expand All @@ -23,7 +27,7 @@ let package = Package(
dependencies: [
.package(
url: "https://github.com/stephencelis/SQLite.swift.git",
.upToNextMajor(from: "0.13.1")),
.upToNextMajor(from: "0.15.1")),
],
targets: [
.target(
Expand All @@ -33,14 +37,16 @@ let package = Package(
],
resources: [
.copy("Resources/PrivacyInfo.xcprivacy")
]
],
swiftSettings: [.enableUpcomingFeature("ExistentialAny")]
),
.target(
name: "ApolloAPI",
dependencies: [],
resources: [
.copy("Resources/PrivacyInfo.xcprivacy")
]
],
swiftSettings: [.enableUpcomingFeature("ExistentialAny")]
),
.target(
name: "ApolloSQLite",
Expand All @@ -50,7 +56,8 @@ let package = Package(
],
resources: [
.copy("Resources/PrivacyInfo.xcprivacy")
]
],
swiftSettings: [.enableUpcomingFeature("ExistentialAny")]
),
.target(
name: "ApolloWebSocket",
Expand All @@ -59,14 +66,16 @@ let package = Package(
],
resources: [
.copy("Resources/PrivacyInfo.xcprivacy")
]
],
swiftSettings: [.enableUpcomingFeature("ExistentialAny")]
),
.target(
name: "ApolloTestSupport",
dependencies: [
"ApolloPGATOUR",
"ApolloAPI"
]
],
swiftSettings: [.enableUpcomingFeature("ExistentialAny")]
),
.plugin(
name: "Install CLI",
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<p align="center">
<img src="https://user-images.githubusercontent.com/146856/124335690-fc7ecd80-db4f-11eb-93fa-dcf4469bb07b.png" alt="Apollo GraphQL"/>
<img src="https://raw.githubusercontent.com/apollographql/apollo-client-devtools/main/assets/apollo-wordmark.svg" alt="Apollo GraphQL"/>
</p>

<p align="center">
Expand Down
Loading

0 comments on commit 3ae7724

Please sign in to comment.