Skip to content

Commit

Permalink
docs: Update API reference
Browse files Browse the repository at this point in the history
  • Loading branch information
calvincestari committed Jul 13, 2022
1 parent b52f379 commit f898919
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 38 deletions.
43 changes: 6 additions & 37 deletions docs/source/api/Apollo/classes/JSONRequest.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions docs/source/api/Apollo/structs/GraphQLResultError.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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.
Expand Down

0 comments on commit f898919

Please sign in to comment.