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 to 1.9.3 #4

Merged
merged 9 commits into from
Apr 13, 2024
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/add-to-project@v0.6.0
uses: actions/add-to-project@v1.0.0
with:
project-url: https://github.com/orgs/apollographql/projects/21
github-token: ${{ secrets.PROMETHEUS_PROJECT_ACCESS_SECRET }}
Expand Down
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# Change Log

## v1.9.3

### Fixed

- **Fix injecting of context for UploadRequest:** Any request context passed into an upload request was not being added to the HTTP request and would not be available to the interceptor chain. See PR ([#302](https://github.com/apollographql/apollo-ios-dev/pull/302)). _Thanks to [@RobertDresler](https://github.com/RobertDresler) for the contribution._
- **Added support for SPM Package.resolved format version 3 ([#3355](https://github.com/apollographql/apollo-ios/issues/3355)):** When using Xcode 15.3 the codegen CLI would fail the `generate` command with an error stating the Package.resolve file version is unsupported. Version 3 is now accepted as a valid file format for the codegen version checker. See PR ([#304](https://github.com/apollographql/apollo-ios-dev/pull/304)).
- **PrivacyInfo.xcprivacy file is invalid for Apollo and ApolloApi ([#3359](https://github.com/apollographql/apollo-ios/issues/3359)):** We received reports that when submitting to the App Store the submission would fail with an error stating that the privacy manifests were invalid. We identified the error and updated the privacy files. See PR ([#309](https://github.com/apollographql/apollo-ios-dev/pull/309)). _Thanks to [@azilbershtein](https://github.com/azilbershtein) for raising the issue._

### Improvement

- **Provide a direct means to observe changes in ApolloStore:** `ApolloStore` now exposes it's subscriber mechanism publicly. This means you can now observe and receive notifications about changes to the store. See PR ([#300](https://github.com/apollographql/apollo-ios-dev/pull/300)). _Thanks to [@jamesonwilliams](https://github.com/jamesonwilliams) for the contribution._
- **Remove redundant iteration in EntitySelectionTree merging algorithm:** The conditions for merging selections were revisited and we identified, and removed, a redundant iteration. This is a significant performance improvement as it removes an entire additional iteration through all the conditional scopes in the tree. See PR ([#308](https://github.com/apollographql/apollo-ios-dev/pull/308)).

## v1.9.2

### Fixed
Expand Down
Binary file modified CLI/apollo-ios-cli.tar.gz
Binary file not shown.
42 changes: 19 additions & 23 deletions ROADMAP.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# 🔮 Apollo iOS Roadmap

**Last updated: 2024-02-20**
**Last updated: 2024-04-02**

For up to date release notes, refer to the project's [Changelog](https://github.com/apollographql/apollo-ios/blob/main/CHANGELOG.md).

Expand All @@ -21,26 +21,10 @@ Please see our [patch releases milestone](https://github.com/apollographql/apoll

As we identify feature sets that we intend to ship, we'll add to and update the subheadings in this section. We intend to keep this section in chronological order. In order to enable rapid and continuous feature delivery, we'll avoid assigning minor version numbers to these feature groups in the roadmap.

### [Configuration to rename generated models for schema types](https://github.com/apollographql/apollo-ios/issues/3283)

_Approximate Date: 2024-03-01_

- Allow client-side users to override the names of schema types in the generated models.
- This will allow user's to improve the quality and expressiveness of client side APIs when schema type names are not appropriate for client usage.
- This also allows workarounds for issues when names of schema types conflict with Swift types.

### [Paginated watchers for GraphQL queries](https://github.com/apollographql/apollo-ios/pull/3007)

_Approximate Date: 2024-03-07_

- Support for Relay-style (cursor-based), offset-based, and arbitrary pagination patterns
- This feature will be considered experimental, meaning that the public API could change in backwards-incompatible ways until it is declared stable in a future release
- This package will be versioned independently from Apollo iOS, beginning with `0.1.0`

### [`@defer` support](https://github.com/apollographql/apollo-ios/issues/2395)

_Now available for preview in the `preview-defer.1` branch_
_Approximate Date: 2024-03-13 (experimental)_
_Approximate Date: 2024-04-09 (experimental)_

The `@defer` directive enables your queries to receive data for specific fields asynchronously. This is helpful whenever some fields in a query take much longer to resolve than others. [Apollo Kotlin](https://www.apollographql.com/docs/kotlin/fetching/defer/) and [Apollo Client (web)](https://www.apollographql.com/docs/react/data/defer/) currently support this syntax, so if you're interested in learning more check out their documentation. Apollo iOS has released a preview version of this feature in the `preview-defer.1` branch. This will be released as an experimental feature in an upcoming `1.x` minor version.

Expand All @@ -60,6 +44,21 @@ _Approximate Date: 2024-04-30_
- Right now we are naively generating schema types that we don't always need. A smarter algorithm can reduce generated code for certain large schemas that are currently having every type in their schema generated
- Create configuration for manually indicating schema types you would like to have schema types and TestMocks generated for

### Swift 6 compatibility

_Approximate Date: 2024-05-17_

- [`Sendable` types](https://github.com/apollographql/apollo-ios/issues/3291)
- [`ExistentialAny` upcoming feature](https://github.com/apollographql/apollo-ios/issues/3205)

### [Configuration to rename generated models for schema types](https://github.com/apollographql/apollo-ios/issues/3283)

_Approximate Date: 2024-05-29_

- Allow client-side users to override the names of schema types in the generated models.
- This will allow user's to improve the quality and expressiveness of client side APIs when schema type names are not appropriate for client usage.
- This also allows workarounds for issues when names of schema types conflict with Swift types.

### [Mutable generated reponse models](https://github.com/apollographql/apollo-ios/issues/3246)

_Approximate Date: TBD_
Expand All @@ -82,12 +81,9 @@ _Approximate Date: TBD_
- Similar to Apollo Kotlin [declarative caching](https://www.apollographql.com/docs/kotlin/caching/declarative-ids) via the `@typePolicy` directive
- Provide ability to configure cache keys using directives on schema types as an alternative to programmatic cache key configuration

### Swift 6 compatibility
## [Apollo iOS Pagination](https://github.com/apollographql/apollo-ios-pagination)

_Approximate Date: TBD_

- [`Sendable` types](https://github.com/apollographql/apollo-ios/issues/3291)
- [`ExistentialAny` upcoming feature](https://github.com/apollographql/apollo-ios/issues/3205)
Version 0.1 of this module was released in March 2024. We are iterating quickly based on user feedback - please see the project's Issues and PRs for up-to-date information. We expect the API to become more stable over time and will consider a v1 release when appropriate.

## [2.0](https://github.com/apollographql/apollo-ios/milestone/60)

Expand Down
20 changes: 16 additions & 4 deletions Sources/Apollo/ApolloStore.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ import ApolloAPI

public typealias DidChangeKeysFunc = (Set<CacheKey>, UUID?) -> Void

protocol ApolloStoreSubscriber: AnyObject {
/// The `ApolloStoreSubscriber` provides a means to observe changes to items in the ApolloStore.
/// This protocol is available for advanced use cases only. Most users will prefer using `ApolloClient.watch(query:)`.
public protocol ApolloStoreSubscriber: AnyObject {

/// A callback that can be received by subscribers when keys are changed within the database
///
Expand All @@ -23,7 +25,7 @@ public class ApolloStore {
private let cache: NormalizedCache
private let queue: DispatchQueue

private var subscribers: [ApolloStoreSubscriber] = []
internal var subscribers: [ApolloStoreSubscriber] = []

/// Designated initializer
/// - Parameters:
Expand Down Expand Up @@ -83,13 +85,23 @@ public class ApolloStore {
}
}

func subscribe(_ subscriber: ApolloStoreSubscriber) {
/// Subscribes to notifications of ApolloStore content changes
///
/// - Parameters:
/// - subscriber: A subscriber to receive content change notificatons. To avoid a retain cycle,
/// ensure you call `unsubscribe` on this subscriber before it goes out of scope.
public func subscribe(_ subscriber: ApolloStoreSubscriber) {
queue.async(flags: .barrier) {
self.subscribers.append(subscriber)
}
}

func unsubscribe(_ subscriber: ApolloStoreSubscriber) {
/// Unsubscribes from notifications of ApolloStore content changes
///
/// - Parameters:
/// - subscriber: A subscribe that has previously been added via `subscribe`. To avoid retain cycles,
/// call `unsubscribe` on all active subscribers before they go out of scope.
public func unsubscribe(_ subscriber: ApolloStoreSubscriber) {
queue.async(flags: .barrier) {
self.subscribers = self.subscribers.filter({ $0 !== subscriber })
}
Expand Down
2 changes: 1 addition & 1 deletion Sources/Apollo/Constants.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Foundation

public enum Constants {
public static let ApolloVersion: String = "1.9.2"
public static let ApolloVersion: String = "1.9.3"
}
6 changes: 3 additions & 3 deletions Sources/Apollo/GraphQLQueryWatcher.swift
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,9 @@ public final class GraphQLQueryWatcher<Query: GraphQLQuery>: Cancellable, Apollo
client?.store.unsubscribe(self)
}

func store(_ store: ApolloStore,
didChangeKeys changedKeys: Set<CacheKey>,
contextIdentifier: UUID?) {
public func store(_ store: ApolloStore,
didChangeKeys changedKeys: Set<CacheKey>,
contextIdentifier: UUID?) {
if
let incomingIdentifier = contextIdentifier,
incomingIdentifier == self.contextIdentifier {
Expand Down
1 change: 1 addition & 0 deletions Sources/Apollo/RequestChainNetworkTransport.swift
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ extension RequestChainNetworkTransport: UploadingNetworkTransport {
additionalHeaders: self.additionalHeaders,
files: files,
manualBoundary: manualBoundary,
context: context,
requestBodyCreator: self.requestBodyCreator)
}

Expand Down
19 changes: 2 additions & 17 deletions Sources/Apollo/Resources/PrivacyInfo.xcprivacy
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,9 @@
<plist version="1.0">
<dict>
<key>NSPrivacyCollectedDataTypes</key>
<array>
<dict>
<key>NSPrivacyCollectedDataType</key>
<string></string>
<key>NSPrivacyCollectedDataTypeLinked</key>
<false/>
<key>NSPrivacyCollectedDataTypeTracking</key>
<false/>
<key>NSPrivacyCollectedDataTypePurposes</key>
<array>
<string></string>
</array>
</dict>
</array>
<array/>
<key>NSPrivacyAccessedAPITypes</key>
<array>
<dict/>
</array>
<array/>
<key>NSPrivacyTrackingDomains</key>
<array/>
<key>NSPrivacyTracking</key>
Expand Down
4 changes: 2 additions & 2 deletions Sources/ApolloAPI/GraphQLOperation.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public enum GraphQLOperationType: Hashable {
/// ``GraphQLOperation``. You can configure the the code generation engine to include the
/// ``OperationDefinition``, ``operationIdentifier``, or both using the `OperationDocumentFormat`
/// options in your `ApolloCodegenConfiguration`.
public struct OperationDocument {
public struct OperationDocument: Sendable {
public let operationIdentifier: String?
public let definition: OperationDefinition?

Expand All @@ -35,7 +35,7 @@ public struct OperationDocument {
/// This data represents the `Definition` for a `Document` as defined in the GraphQL Spec.
/// In the case of the Apollo client, the definition will always be an `ExecutableDefinition`.
/// - See: [GraphQLSpec - Document](https://spec.graphql.org/draft/#Document)
public struct OperationDefinition {
public struct OperationDefinition: Sendable {
let operationDefinition: String
let fragments: [any Fragment.Type]?

Expand Down
19 changes: 2 additions & 17 deletions Sources/ApolloAPI/Resources/PrivacyInfo.xcprivacy
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,9 @@
<plist version="1.0">
<dict>
<key>NSPrivacyCollectedDataTypes</key>
<array>
<dict>
<key>NSPrivacyCollectedDataType</key>
<string></string>
<key>NSPrivacyCollectedDataTypeLinked</key>
<false/>
<key>NSPrivacyCollectedDataTypeTracking</key>
<false/>
<key>NSPrivacyCollectedDataTypePurposes</key>
<array>
<string></string>
</array>
</dict>
</array>
<array/>
<key>NSPrivacyAccessedAPITypes</key>
<array>
<dict/>
</array>
<array/>
<key>NSPrivacyTrackingDomains</key>
<array/>
<key>NSPrivacyTracking</key>
Expand Down
2 changes: 1 addition & 1 deletion Sources/ApolloAPI/SchemaTypes/Interface.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
///
/// # See Also
/// [GraphQLSpec - Interfaces](https://spec.graphql.org/draft/#sec-Interfaces)
public struct Interface: Hashable {
public struct Interface: Hashable, Sendable {
/// The name of the ``Interface`` in the GraphQL schema.
public let name: String

Expand Down
12 changes: 1 addition & 11 deletions Sources/ApolloAPI/SchemaTypes/Object.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/// Each `type` defined in the GraphQL schema will have an instance of ``Object`` generated.
/// # See Also
/// [GraphQLSpec - Objects](https://spec.graphql.org/draft/#sec-Objects)
public struct Object: Hashable {
public struct Object: Hashable, Sendable {

/// Designated Initializer
///
Expand Down Expand Up @@ -34,14 +34,4 @@ public struct Object: Hashable {
public func implements(_ interface: Interface) -> Bool {
implementedInterfaces.contains(where: { $0 == interface })
}

public static func == (lhs: Object, rhs: Object) -> Bool {
return lhs.typename == rhs.typename &&
lhs.implementedInterfaces == rhs.implementedInterfaces
}

public func hash(into hasher: inout Hasher) {
hasher.combine(typename)
hasher.combine(implementedInterfaces)
}
}
2 changes: 1 addition & 1 deletion Sources/ApolloAPI/SchemaTypes/Union.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
///
/// # See Also
/// [GraphQLSpec - Unions](https://spec.graphql.org/draft/#sec-Unions)
public struct Union: Hashable {
public struct Union: Hashable, Sendable {
/// The name of the ``Union`` in the GraphQL schema.
public let name: String

Expand Down
19 changes: 2 additions & 17 deletions Sources/ApolloSQLite/Resources/PrivacyInfo.xcprivacy
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,9 @@
<plist version="1.0">
<dict>
<key>NSPrivacyCollectedDataTypes</key>
<array>
<dict>
<key>NSPrivacyCollectedDataType</key>
<string></string>
<key>NSPrivacyCollectedDataTypeLinked</key>
<false/>
<key>NSPrivacyCollectedDataTypeTracking</key>
<false/>
<key>NSPrivacyCollectedDataTypePurposes</key>
<array>
<string></string>
</array>
</dict>
</array>
<array/>
<key>NSPrivacyAccessedAPITypes</key>
<array>
<dict/>
</array>
<array/>
<key>NSPrivacyTrackingDomains</key>
<array/>
<key>NSPrivacyTracking</key>
Expand Down
19 changes: 2 additions & 17 deletions Sources/ApolloWebSocket/Resources/PrivacyInfo.xcprivacy
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,9 @@
<plist version="1.0">
<dict>
<key>NSPrivacyCollectedDataTypes</key>
<array>
<dict>
<key>NSPrivacyCollectedDataType</key>
<string></string>
<key>NSPrivacyCollectedDataTypeLinked</key>
<false/>
<key>NSPrivacyCollectedDataTypeTracking</key>
<false/>
<key>NSPrivacyCollectedDataTypePurposes</key>
<array>
<string></string>
</array>
</dict>
</array>
<array/>
<key>NSPrivacyAccessedAPITypes</key>
<array>
<dict/>
</array>
<array/>
<key>NSPrivacyTrackingDomains</key>
<array/>
<key>NSPrivacyTracking</key>
Expand Down
Loading