You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+16-5Lines changed: 16 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -200,13 +200,12 @@ defer {
200
200
try? group.syncShutdownGracefully()
201
201
}
202
202
203
-
api.execute(
203
+
let result =tryawaitapi.execute(
204
204
request: "{ message { content } }",
205
205
context: Context(),
206
206
on: group
207
-
).whenSuccess { result in
208
-
print(result)
209
-
}
207
+
)
208
+
print(result)
210
209
```
211
210
212
211
The output will be:
@@ -219,7 +218,19 @@ The output will be:
219
218
220
219
#### Async resolvers
221
220
222
-
To use async resolvers, just add one more parameter with type `EventLoopGroup` to the resolver function and change the return type to `EventLoopFuture<YouReturnType>`. Don't forget to import NIO.
The resolver functions also support `NIO`-style concurrency. To do so, just add one more parameter with type `EventLoopGroup` to the resolver function and change the return type to `EventLoopFuture<YouReturnType>`. Don't forget to import NIO.
0 commit comments