From f8989197a3db72cf79af2c8910dabd7d5b90038e Mon Sep 17 00:00:00 2001 From: Calvin Cestari Date: Wed, 13 Jul 2022 11:26:38 +0200 Subject: [PATCH] docs: Update API reference --- docs/source/api/Apollo/classes/JSONRequest.md | 43 +++---------------- .../api/Apollo/structs/GraphQLResultError.md | 6 +++ .../structs/ApolloCodegenOptions.md | 4 +- 3 files changed, 15 insertions(+), 38 deletions(-) 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.