Skip to content

Commit 3bd463d

Browse files
committed
Update README
1 parent fcbd981 commit 3bd463d

File tree

3 files changed

+12
-13
lines changed

3 files changed

+12
-13
lines changed

Package.swift

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,14 @@
1-
// swift-tools-version:5.0
1+
// swift-tools-version:5.1
22
import PackageDescription
33

44
let package = Package(
55
name: "GraphQL",
6-
76
products: [
87
.library(name: "GraphQL", targets: ["GraphQL"]),
98
],
10-
119
dependencies: [
1210
.package(url: "https://github.com/apple/swift-nio.git", from: "1.14.1"),
1311
],
14-
1512
targets: [
1613
.target(name: "GraphQL", dependencies: ["NIO"]),
1714
.testTarget(name: "GraphQLTests", dependencies: ["GraphQL"]),

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ import PackageDescription
3737

3838
let package = Package(
3939
dependencies: [
40-
.package(url: "https://github.com/GraphQLSwift/GraphQL.git", from: "0.9.0"),
40+
.package(url: "https://github.com/GraphQLSwift/GraphQL.git", from: "0.10.0"),
4141
]
4242
)
4343
```
@@ -56,7 +56,9 @@ let schema = try GraphQLSchema(
5656
fields: [
5757
"hello": GraphQLField(
5858
type: GraphQLString,
59-
resolve: { _, _, _, _ in "world" }
59+
resolve: { _, _, _, _ in
60+
"world"
61+
}
6062
)
6163
]
6264
)

Sources/GraphQL/Utilities/NIO+Extensions.swift

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,30 +11,30 @@ import NIO
1111
public typealias Future = EventLoopFuture
1212

1313
extension Collection {
14-
public func flatten<T>(on worker: EventLoopGroup) -> Future<[T]> where Element == Future<T> {
15-
return Future.whenAll(Array(self), eventLoop: worker.next())
14+
public func flatten<T>(on eventLoopGroup: EventLoopGroup) -> Future<[T]> where Element == Future<T> {
15+
return Future.whenAll(Array(self), eventLoop: eventLoopGroup.next())
1616
}
1717
}
1818

1919
extension Collection {
2020
public func flatMap<S, T>(
2121
to type: T.Type,
22-
on worker: EventLoopGroup,
22+
on eventLoopGroup: EventLoopGroup,
2323
_ callback: @escaping ([S]) throws -> Future<T>
2424
) -> Future<T> where Element == Future<S> {
25-
return flatten(on: worker).flatMap(to: T.self, callback)
25+
return flatten(on: eventLoopGroup).flatMap(to: T.self, callback)
2626
}
2727
}
2828

2929
extension Dictionary where Value : FutureType {
30-
func flatten(on worker: EventLoopGroup) -> Future<[Key: Value.Expectation]> {
30+
func flatten(on eventLoopGroup: EventLoopGroup) -> Future<[Key: Value.Expectation]> {
3131
var elements: [Key: Value.Expectation] = [:]
3232

3333
guard self.count > 0 else {
34-
return worker.next().newSucceededFuture(result: elements)
34+
return eventLoopGroup.next().newSucceededFuture(result: elements)
3535
}
3636

37-
let promise: EventLoopPromise<[Key: Value.Expectation]> = worker.next().newPromise()
37+
let promise: EventLoopPromise<[Key: Value.Expectation]> = eventLoopGroup.next().newPromise()
3838
elements.reserveCapacity(self.count)
3939

4040
for (key, value) in self {

0 commit comments

Comments
 (0)