Skip to content

Commit

Permalink
Update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
calvincestari committed Feb 25, 2022
1 parent 438b224 commit d94bc13
Show file tree
Hide file tree
Showing 5 changed files with 90 additions and 10 deletions.
4 changes: 2 additions & 2 deletions docs/source/api/ApolloCodegenLib/classes/JavaScriptError.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
# `JavaScriptError`

```swift
public class JavaScriptError: JavaScriptObject, Error
public class JavaScriptError: JavaScriptObject, Error, @unchecked Sendable
```

An errror thrown during JavaScript execution.
An error thrown during JavaScript execution.
See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Designated initializer.
- outputFormat: The `OutputFormat` enum option to use to output generated code.
- customScalarFormat: How to handle properties using a custom scalar from the schema.
- suppressSwiftMultilineStringLiterals: Don't use multi-line string literals when generating code. Defaults to false.
- urlToSchemaFile: The URL to your schema file.
- urlToSchemaFile: The URL to your schema file. Accepted file types are `.json` for JSON files, or either `.graphqls` or `.sdl` for Schema Definition Language files.
- downloadTimeout: The maximum time to wait before indicating that the download timed out, in seconds. Defaults to 30 seconds.

### `init(targetRootURL:codegenEngine:downloadTimeout:)`
Expand Down
1 change: 1 addition & 0 deletions docs/source/api/ApolloWebSocket/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@

- [WSError.ErrorType](enums/WSError.ErrorType/)
- [WebSocket.OpCode](enums/WebSocket.OpCode/)
- [WebSocket.WSProtocol](enums/WebSocket.WSProtocol/)
- [WebSocketError.ErrorKind](enums/WebSocketError.ErrorKind/)

## Extensions
Expand Down
58 changes: 51 additions & 7 deletions docs/source/api/ApolloWebSocket/classes/WebSocket.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,26 +125,70 @@ public var respondToPingWithPong: Bool = true
```

## Methods
### `init(request:)`
### `init(request:protocol:)`

```swift
public init(request: URLRequest)
public init(request: URLRequest, protocol: WSProtocol)
```

Used for setting protocols.
Designated initializer.

### `init(url:)`
- Parameters:
- request: A URL request object that provides request-specific information such as the URL.
- protocol: Protocol to use for communication over the web socket.

#### Parameters

| Name | Description |
| ---- | ----------- |
| request | A URL request object that provides request-specific information such as the URL. |
| protocol | Protocol to use for communication over the web socket. |

### `init(url:protocol:)`

```swift
public convenience init(url: URL)
public convenience init(url: URL, protocol: WSProtocol)
```

### `init(url:writeQueueQOS:)`
Convenience initializer to specify the URL and web socket protocol.

- Parameters:
- url: The destination URL to connect to.
- protocol: Protocol to use for communication over the web socket.

#### Parameters

| Name | Description |
| ---- | ----------- |
| url | The destination URL to connect to. |
| protocol | Protocol to use for communication over the web socket. |

### `init(url:writeQueueQOS:protocol:)`

```swift
public convenience init(url: URL, writeQueueQOS: QualityOfService)
public convenience init(
url: URL,
writeQueueQOS: QualityOfService,
protocol: WSProtocol
)
```

Convenience initializer to specify the URL and web socket protocol with a specific quality of
service on the write queue.

- Parameters:
- url: The destination URL to connect to.
- writeQueueQOS: Specifies the quality of service for the write queue.
- protocol: Protocol to use for communication over the web socket.

#### Parameters

| Name | Description |
| ---- | ----------- |
| url | The destination URL to connect to. |
| writeQueueQOS | Specifies the quality of service for the write queue. |
| protocol | Protocol to use for communication over the web socket. |

### `connect()`

```swift
Expand Down
35 changes: 35 additions & 0 deletions docs/source/api/ApolloWebSocket/enums/WebSocket.WSProtocol.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
**ENUM**

# `WebSocket.WSProtocol`

```swift
public enum WSProtocol: CustomStringConvertible
```

The GraphQL over WebSocket protocols supported by apollo-ios.

## Cases
### `graphql_ws`

```swift
case graphql_ws
```

WebSocket protocol `graphql-ws`. This is implemented by the [subscriptions-transport-ws](https://github.com/apollographql/subscriptions-transport-ws)
and AWS AppSync libraries.

### `graphql_transport_ws`

```swift
case graphql_transport_ws
```

WebSocket protocol `graphql-transport-ws`. This is implemented by the [graphql-ws](https://github.com/enisdenjo/graphql-ws)
library.

## Properties
### `description`

```swift
public var description: String
```

0 comments on commit d94bc13

Please sign in to comment.