diff --git a/CHANGELOG.md b/CHANGELOG.md index 749744b806..14c0a4513c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Change log +## v0.52.0 +- **Add codegen option for excludes**: There is a new property on the codegen configuration options to allow files matching the pattern to be excluded, in the case they are found in the `includes` path. [#2205](https://github.com/apollographql/apollo-ios/pull/2205) - _Thanks to [@bannzai](https://github.com/bannzai) for the contribution!_ +- **Fixed - Using the `graphql_transport_ws` protocol could result in `4400` errors from the server**: The correct protocol message is now being sent to the server to end communication. [#2320](https://github.com/apollographql/apollo-ios/pull/2320) +- **Replace `print` statement with `CodegenLogger.log`**: All codegen output is logged with `CodegenLogger` which can be disabled if needed. [#2348](https://github.com/apollographql/apollo-ios/issues/2348) - _Thanks to [@hiltonc](https://github.com/hiltonc) for the contribution!_ +- **Expose `GraphQLResultError` path string**: Adds a new publicly available computed property to `GraphQLResultError` which just exposes the `path` description. [#2361](https://github.com/apollographql/apollo-ios/pull/2361) - _Thanks to [@joshuashroyer-toast](https://github.com/joshuashroyer-toast) for the contribution!_ + ## v0.51.2 - **Fixed - APQ Retrying Failing in 0.51.1**: Fixes a bug introduced in the last version that broke APQs. _Thanks to [Kyle Browning](https://github.com/kylebrowning) for bringing this to our attention._ diff --git a/Configuration/Shared/Project-Version.xcconfig b/Configuration/Shared/Project-Version.xcconfig index c1683fe4ae..f45940d6a2 100644 --- a/Configuration/Shared/Project-Version.xcconfig +++ b/Configuration/Shared/Project-Version.xcconfig @@ -1 +1 @@ -CURRENT_PROJECT_VERSION = 0.51.2 +CURRENT_PROJECT_VERSION = 0.52.0 diff --git a/SwiftScripts/Package.resolved b/SwiftScripts/Package.resolved index 446d6343af..7f39734a48 100644 --- a/SwiftScripts/Package.resolved +++ b/SwiftScripts/Package.resolved @@ -1,15 +1,6 @@ { "object": { "pins": [ - { - "package": "Commandant", - "repositoryURL": "https://github.com/Carthage/Commandant.git", - "state": { - "branch": null, - "revision": "ab68611013dec67413628ac87c1f29e8427bc8e4", - "version": "0.17.0" - } - }, { "package": "MarkdownGenerator", "repositoryURL": "https://github.com/eneko/MarkdownGenerator.git", @@ -19,15 +10,6 @@ "version": "0.5.0" } }, - { - "package": "Nimble", - "repositoryURL": "https://github.com/Quick/Nimble.git", - "state": { - "branch": null, - "revision": "72f5a90d573f7f7d70aa6b8ad84b3e1e02eabb4d", - "version": "8.0.9" - } - }, { "package": "ProcessRunner", "repositoryURL": "https://github.com/eneko/ProcessRunner.git", @@ -37,22 +19,13 @@ "version": "1.1.0" } }, - { - "package": "Quick", - "repositoryURL": "https://github.com/Quick/Quick.git", - "state": { - "branch": null, - "revision": "09b3becb37cb2163919a3842a4c5fa6ec7130792", - "version": "2.2.1" - } - }, { "package": "Rainbow", "repositoryURL": "https://github.com/onevcat/Rainbow", "state": { "branch": null, - "revision": "9c52c1952e9b2305d4507cf473392ac2d7c9b155", - "version": "3.1.5" + "revision": "626c3d4b6b55354b4af3aa309f998fae9b31a3d9", + "version": "3.2.0" } }, { @@ -60,8 +33,8 @@ "repositoryURL": "https://github.com/eneko/SourceDocs.git", "state": { "branch": null, - "revision": "3a38adfe18ca73dfc2136b4b8c49407d1a812d50", - "version": "2.0.0" + "revision": "fb0e489e3a26c789aad3adbe43e2169f50f485e8", + "version": "2.0.1" } }, { @@ -69,8 +42,8 @@ "repositoryURL": "https://github.com/jpsim/SourceKitten.git", "state": { "branch": null, - "revision": "77a4dbbb477a8110eb8765e3c44c70fb4929098f", - "version": "0.29.0" + "revision": "817dfa6f2e09b0476f3a6c9dbc035991f02f0241", + "version": "0.32.0" } }, { @@ -78,8 +51,8 @@ "repositoryURL": "https://github.com/stephencelis/SQLite.swift.git", "state": { "branch": null, - "revision": "60a65015f6402b7c34b9a924f755ca0a73afeeaa", - "version": "0.13.1" + "revision": "4d543d811ee644fa4cc4bfa0be996b4dd6ba0f54", + "version": "0.13.3" } }, { @@ -87,8 +60,8 @@ "repositoryURL": "https://github.com/apple/swift-argument-parser.git", "state": { "branch": null, - "revision": "e1465042f195f374b94f915ba8ca49de24300a0d", - "version": "1.0.2" + "revision": "e394bf350e38cb100b6bc4172834770ede1b7232", + "version": "1.0.3" } }, { @@ -96,8 +69,8 @@ "repositoryURL": "https://github.com/drmohundro/SWXMLHash.git", "state": { "branch": null, - "revision": "a4931e5c3bafbedeb1601d3bb76bbe835c6d475a", - "version": "5.0.1" + "revision": "6469881a3f30417c5bb02404ea4b69207f297592", + "version": "6.0.0" } }, { @@ -105,8 +78,8 @@ "repositoryURL": "https://github.com/jpsim/Yams.git", "state": { "branch": null, - "revision": "c947a306d2e80ecb2c0859047b35c73b8e1ca27f", - "version": "2.0.0" + "revision": "9ff1cc9327586db4e0c8f46f064b6a82ec1566fa", + "version": "4.0.6" } } ] diff --git a/docs/source/api/Apollo/classes/JSONRequest.md b/docs/source/api/Apollo/classes/JSONRequest.md index 4a5e91cf8f..f6a5a1c5e4 100644 --- a/docs/source/api/Apollo/classes/JSONRequest.md +++ b/docs/source/api/Apollo/classes/JSONRequest.md @@ -39,53 +39,22 @@ public let useGETForPersistedQueryRetry: Bool public var isPersistedQueryRetry = false ``` -### `serializationFormat` +### `body` ```swift -public let serializationFormat = JSONSerializationFormat.self +public var body: GraphQLMap ``` -### `sendOperationIdentifier` +### `serializationFormat` ```swift -open var sendOperationIdentifier: Bool +public let serializationFormat = JSONSerializationFormat.self ``` -### `body` +### `sendOperationIdentifier` ```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 -}() +open var sendOperationIdentifier: Bool ``` ## Methods diff --git a/docs/source/api/Apollo/structs/GraphQLResultError.md b/docs/source/api/Apollo/structs/GraphQLResultError.md index ac0feee23c..d8938b3533 100644 --- a/docs/source/api/Apollo/structs/GraphQLResultError.md +++ b/docs/source/api/Apollo/structs/GraphQLResultError.md @@ -9,6 +9,12 @@ public struct GraphQLResultError: Error, LocalizedError An error which has occurred in processing a GraphQLResult ## Properties +### `pathString` + +```swift +public var pathString: String +``` + ### `underlying` ```swift diff --git a/docs/source/api/ApolloCodegenLib/structs/ApolloCodegenOptions.md b/docs/source/api/ApolloCodegenLib/structs/ApolloCodegenOptions.md index 2a50ecdebb..69121fa041 100644 --- a/docs/source/api/ApolloCodegenLib/structs/ApolloCodegenOptions.md +++ b/docs/source/api/ApolloCodegenLib/structs/ApolloCodegenOptions.md @@ -9,11 +9,12 @@ public struct ApolloCodegenOptions An object to hold all the various options for running codegen ## Methods -### `init(codegenEngine:includes:mergeInFieldsFromFragmentSpreads:modifier:namespace:omitDeprecatedEnumCases:only:operationIDsURL:outputFormat:customScalarFormat:suppressSwiftMultilineStringLiterals:urlToSchemaFile:downloadTimeout:)` +### `init(codegenEngine:includes:excludes:mergeInFieldsFromFragmentSpreads:modifier:namespace:omitDeprecatedEnumCases:only:operationIDsURL:outputFormat:customScalarFormat:suppressSwiftMultilineStringLiterals:urlToSchemaFile:downloadTimeout:)` ```swift public init(codegenEngine: CodeGenerationEngine = .default, includes: String = "./**/*.graphql", + excludes: String? = nil, mergeInFieldsFromFragmentSpreads: Bool = true, modifier: AccessModifier = .public, namespace: String? = nil, @@ -32,6 +33,7 @@ Designated initializer. - Parameters: - codegenEngine: The code generation engine to use. Defaults to `CodeGenerationEngine.default` - includes: Glob of files to search for GraphQL operations. This should be used to find queries *and* any client schema extensions. Defaults to `./**/*.graphql`, which will search for `.graphql` files throughout all subfolders of the folder where the script is run. + - excludes: Glob of files to exclude for GraphQL operations. Caveat: this doesn't currently work in watch mode - mergeInFieldsFromFragmentSpreads: Set true to merge fragment fields onto its enclosing type. Defaults to true. - modifier: [EXPERIMENTAL SWIFT CODEGEN ONLY] - The access modifier to use on everything created by this tool. Defaults to `.public`. - namespace: [optional] The namespace to emit generated code into. Defaults to nil.