Skip to content

Commit a4e9c48

Browse files
Merge pull request #12 from GraphQLSwift/fix/websocket-collection-size
v1.0 Cleanup
2 parents 8ea0982 + 3a5c927 commit a4e9c48

3 files changed

Lines changed: 10 additions & 9 deletions

File tree

README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
[![](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2FGraphQLSwift%2Fgraphql-hummingbird%2Fbadge%3Ftype%3Dplatforms)](https://swiftpackageindex.com/GraphQLSwift/graphql-hummingbird)
44
[![](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2FGraphQLSwift%2Fgraphql-hummingbird%2Fbadge%3Ftype%3Dswift-versions)](https://swiftpackageindex.com/GraphQLSwift/graphql-hummingbird)
55

6-
> ***WARNING***: This package is in v0.x beta. It's API is still evolving and is subject to breaking changes in minor version bumps.
7-
86
A Swift library for integrating [GraphQL](https://github.com/GraphQLSwift/GraphQL) with [Hummingbird](https://github.com/hummingbird-project/hummingbird), enabling you to easily expose GraphQL APIs in your Hummingbird applications.
97

108
## Features

Sources/GraphQLHummingbird/GraphQLConfig.swift

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,13 @@ public struct GraphQLConfig<
4545
self.websocket = websocket
4646
}
4747

48+
/// A collection of encoders and decoders used by the GraphQL system
4849
public struct Coders: Sendable {
49-
public let graphQLJSONEncoder: GraphQLJSONEncoder
50-
public let jsonDecoder: JSONDecoder
51-
public let jsonEncoder: JSONEncoder
52-
public let urlEncodedFormDecoder: URLEncodedFormDecoder
53-
public let urlEncodedFormEncoder: URLEncodedFormEncoder
50+
let graphQLJSONEncoder: GraphQLJSONEncoder
51+
let jsonDecoder: JSONDecoder
52+
let jsonEncoder: JSONEncoder
53+
let urlEncodedFormDecoder: URLEncodedFormDecoder
54+
let urlEncodedFormEncoder: URLEncodedFormEncoder
5455

5556
public init(
5657
graphQLJSONEncoder: GraphQLJSONEncoder? = nil,
@@ -67,6 +68,7 @@ public struct GraphQLConfig<
6768
}
6869
}
6970

71+
/// An embeddable GraphQL IDE
7072
public struct IDE: Sendable, Equatable {
7173
/// GraphiQL: https://github.com/graphql/graphiql
7274
public static var graphiql: Self {
@@ -85,6 +87,7 @@ public struct GraphQLConfig<
8587
}
8688
}
8789

90+
/// A GraphQL subscription implementation
8891
public struct SubscriptionProtocol: Sendable, Hashable {
8992
/// Expose GraphQL subscriptions over WebSockets
9093
public static var websocket: Self {
@@ -97,6 +100,7 @@ public struct GraphQLConfig<
97100
}
98101
}
99102

103+
/// WebSocket configuration
100104
public struct WebSocket: Sendable {
101105
let onWebSocketInit: @Sendable (WebSocketInit, Request, Context) async throws -> WebSocketInitResult
102106

Sources/GraphQLHummingbird/WebSocket/GraphQLHandler+handleWebSocket.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@ extension GraphQLHandler where Context: WebSocketRequestContext {
1616
) async throws {
1717
let messenger = WebSocketMessenger(outbound: outbound, logger: logger)
1818

19-
// TODO: Make maxSize configurable
20-
let messageStream = inbound.messages(maxSize: 1024 * 1024).compactMap { message -> String? in
19+
let messageStream = inbound.messages(maxSize: context.requestContext.maxUploadSize).compactMap { message -> String? in
2120
// TODO: Add binary support
2221
guard case let .text(text) = message else {
2322
return nil

0 commit comments

Comments
 (0)