Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update/apollo 1.15.2 #19

Closed
wants to merge 52 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
1667644
2024-04-16 Roadmap Update
bignimbus Apr 16, 2024
631f237
chore(deps): SECOPS - 2024-04-22 (apollographql/apollo-ios-dev#342)
calvincestari Apr 22, 2024
d1d37bf
Add refetchOnFailedUpdates to query watcher (apollographql/apollo-ios…
AnthonyMDev Apr 25, 2024
da5ff68
Update ROADMAP.md
AnthonyMDev Apr 30, 2024
8f26d38
Update ROADMAP.md
AnthonyMDev Apr 30, 2024
23c3643
Update ROADMAP.md
AnthonyMDev May 14, 2024
fe7763b
Release 1.11.0 (apollographql/apollo-ios-dev#360)
AnthonyMDev May 15, 2024
8ee9643
Attach cli to release
AnthonyMDev May 15, 2024
da19e5e
fix: Adds visionOS deployment to ApolloTestSupport podspec (apollogra…
calvincestari May 20, 2024
d502e94
Add @_spi(Execution) to executor for import in test mocks (apollograp…
AnthonyMDev May 20, 2024
e2ef771
release: (apollographql/apollo-ios-dev#365)
calvincestari May 21, 2024
f5d918e
release: (apollographql/apollo-ios-dev#366)
calvincestari May 22, 2024
99dfbdb
release: (apollographql/apollo-ios-dev#367)
calvincestari May 23, 2024
f511696
Update ROADMAP.md
AnthonyMDev May 28, 2024
4a7167c
Set integration tests to run on macos-13 (#378)
AnthonyMDev May 31, 2024
522176b
Set integration tests to run on macos-13 (apollographql/apollo-ios-de…
ejensen May 31, 2024
3188d6a
Added Existential Any requirement (apollographql/apollo-ios-dev#379)
AnthonyMDev Jun 6, 2024
b52a861
JSONConverter helper (apollographql/apollo-ios-dev#380)
AnthonyMDev Jun 7, 2024
cdce077
Fix compile errors
Mordil Jun 10, 2024
22cc0b6
Fix building ApolloSQLite with Xcode 16b1 (apollographql/apollo-ios-d…
rastersize Jun 10, 2024
19aa89e
Update ROADMAP.md (apollographql/apollo-ios-dev#389)
AnthonyMDev Jun 13, 2024
8dd101d
Release 1.13.0 (apollographql/apollo-ios-dev#399)
github-actions[bot] Jun 25, 2024
8419608
Update ROADMAP.md
AnthonyMDev Jun 25, 2024
aa8db7c
chore(deps): update actions/add-to-project action to v1.0.2 (apollogr…
svc-secops Jul 2, 2024
fe32638
Adding debugDescription to SelectionSets (apollographql/apollo-ios-de…
BobaFetters Jul 2, 2024
dbe5350
[README] Add dark mode logo (apollographql/apollo-ios-dev#420)
martinbonnin Jul 9, 2024
9b87ee0
fix: Local cache mutation build error in Swift 6 (apollographql/apoll…
calvincestari Jul 11, 2024
06c1a89
Update ROADMAP.md
AnthonyMDev Jul 16, 2024
b73d4bb
feature: GraphQL execution for `@defer` support (apollographql/apollo…
calvincestari Jul 19, 2024
e218b56
Release 1.14.0 (apollographql/apollo-ios-dev#434)
apollo-bot2 Jul 19, 2024
39098c5
fix: Cache write interceptor should gracefully handle missing cache r…
calvincestari Jul 24, 2024
9d0bb80
fix Array JSONEncodable (apollographql/apollo-ios-dev#128)
arnauddorgans Jul 29, 2024
5f52953
Update ROADMAP.md
AnthonyMDev Jul 30, 2024
70c3447
feature: Add function to set journal mode on sqlite databases (apollo…
calvincestari Jul 30, 2024
104cc94
Release 1.14.1 (apollographql/apollo-ios-dev#451)
apollo-bot2 Aug 2, 2024
2ab4500
fix: `legacyResponse` property (apollographql/apollo-ios-dev#456)
calvincestari Aug 8, 2024
7d0c7e9
Fix a leak related to use of function used in a closure (apollographq…
prabhuamol Aug 8, 2024
65d7a19
Update ROADMAP.md
AnthonyMDev Aug 13, 2024
1da33d3
fix: `ObjectData` type check (apollographql/apollo-ios-dev#459)
calvincestari Aug 13, 2024
24a43a4
Release 1.15.0 (apollographql/apollo-ios-dev#462)
apollo-bot2 Aug 16, 2024
05947e5
fix: Disfavour deprecated `watch` function (apollographql/apollo-ios-…
calvincestari Aug 26, 2024
e708507
Release 1.15.1 (apollographql/apollo-ios-dev#471)
apollo-bot2 Aug 26, 2024
f0c89da
Update ROADMAP.md
AnthonyMDev Aug 27, 2024
6620447
enhancement: Set URLRequest cache policy on GET requests (apollograph…
calvincestari Sep 11, 2024
6c96744
fix: Cherry pick `ObjectData` type check to `ListData` (apollographql…
calvincestari Sep 13, 2024
898597b
chore: Required swift-tools-version update (apollographql/apollo-ios-…
calvincestari Sep 13, 2024
8f26ccb
Update ROADMAP.md
AnthonyMDev Sep 24, 2024
8e4cbf7
Batch writing of records to SQLite store (apollographql/apollo-ios-de…
AnthonyMDev Oct 1, 2024
7122421
Release 1.15.2 (apollographql/apollo-ios-dev#499)
apollo-bot2 Oct 1, 2024
b4b5da7
Fix merge conflicts
filipealva Oct 27, 2024
cc832e1
Add missing comma
filipealva Oct 27, 2024
9b123c1
Add missing initializer
filipealva Oct 27, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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.2

### Improvements
- **Set `URLRequest` cache policy on GET requests ([#476](https://github.com/apollographql/apollo-ios-dev/pull/476)):** Uses the Apollo cache policy to set a comparable cache policy on `URLRequest`. Previously there was no way to opt-out of default `URLRequest` caching behaviour.
- **Batch writing records to the SQLite store ([#498](https://github.com/apollographql/apollo-ios-dev/pull/498)):** Uses the `insertMany` to batch write records for a given operation vs previously performing a write for each individual record.

### Fixed
- **Fix `ListData` type check ([#473](https://github.com/apollographql/apollo-ios-dev/pull/473)):** Fixed bool type check in `ListData`.
- **Remove local cache mutation type condition setter ([#485](https://github.com/apollographql/apollo-ios-dev/pull/485)):** Removes the setter for mutable inline fragments. The correct way to initialize with a type condition is to use `asRootEntityType`.

## 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
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
18 changes: 13 additions & 5 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 Down Expand Up @@ -34,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 @@ -51,7 +56,8 @@ let package = Package(
],
resources: [
.copy("Resources/PrivacyInfo.xcprivacy")
]
],
swiftSettings: [.enableUpcomingFeature("ExistentialAny")]
),
.target(
name: "ApolloWebSocket",
Expand All @@ -60,7 +66,8 @@ let package = Package(
],
resources: [
.copy("Resources/PrivacyInfo.xcprivacy")
]
],
swiftSettings: [.enableUpcomingFeature("ExistentialAny")]
),
.target(
name: "ApolloTestSupport",
Expand All @@ -78,7 +85,8 @@ let package = Package(
"ApolloSQLite",
"ApolloWebSocket",
"ApolloTestSupport",
]
],
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
Loading