Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Change log

## v0.51.1
- **Expose request body creation to better support custom interceptors**: Enable lazy access to the request body creation for leverage in custom built interceptors, since JSONRequest.toURLRequest() encapsulates the creation. This enables the GraphQLMap to be accessed without re-creating the body. [#2184](https://github.com/apollographql/apollo-ios/pull/2184) - _Thanks to [Rick Fast](https://github.com/rickfast) for the contribution._

## v0.51.0
- **Allow periods in arguments to be ignored when parsing cacheKeys**: If your query arguments include periods they will no longer cause broken cache keys. This means the cached data for those queries can be correctly found and returned. The caveat with this change though is that if you use a persisted cache, after the upgrade you could see cache misses and the data would be refetched. [#2057](https://github.com/apollographql/apollo-ios/pull/2057) - _Thanks to [Hesham Salman](https://github.com/Iron-Ham) for the contribution._
- **Fixed - [`Sendable` class `JavaScriptError` cannot inherit from another class other than `NSObject`](https://github.com/apollographql/apollo-ios/issues/2146):** Xcode 13.3 introduced some additional requirements for `Error` types and `JavaScriptError` did not conform causing compile errors in `ApolloCodegenLib`. This change disables `Sendable` type checking for `JavaScriptError` while maintaining type-safety across concurrency boundaries. [#2147](https://github.com/apollographql/apollo-ios/pull/2147) - _Thank you to [Tiziano Coroneo](https://github.com/TizianoCoroneo) for the contribution._
Expand Down
2 changes: 1 addition & 1 deletion Configuration/Shared/Project-Version.xcconfig
Original file line number Diff line number Diff line change
@@ -1 +1 @@
CURRENT_PROJECT_VERSION = 0.51.0
CURRENT_PROJECT_VERSION = 0.51.1
37 changes: 37 additions & 0 deletions docs/source/api/Apollo/classes/JSONRequest.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,43 @@ public let serializationFormat = JSONSerializationFormat.self
open var sendOperationIdentifier: Bool
```

### `body`

```swift
public private(set) lazy var body: GraphQLMap = {
let sendQueryDocument: Bool
let autoPersistQueries: Bool
switch operation.operationType {
case .query:
if isPersistedQueryRetry {
sendQueryDocument = true
autoPersistQueries = true
} else {
sendQueryDocument = !self.autoPersistQueries
autoPersistQueries = self.autoPersistQueries
}
case .mutation:
if isPersistedQueryRetry {
sendQueryDocument = true
autoPersistQueries = true
} else {
sendQueryDocument = !self.autoPersistQueries
autoPersistQueries = self.autoPersistQueries
}
default:
sendQueryDocument = true
autoPersistQueries = false
}

let body = self.requestBodyCreator.requestBody(for: operation,
sendOperationIdentifiers: self.sendOperationIdentifier,
sendQueryDocument: sendQueryDocument,
autoPersistQuery: autoPersistQueries)

return body
}()
```

## Methods
### `init(operation:graphQLEndpoint:contextIdentifier:clientName:clientVersion:additionalHeaders:cachePolicy:autoPersistQueries:useGETForQueries:useGETForPersistedQueryRetry:requestBodyCreator:)`

Expand Down