File tree 1 file changed +4
-4
lines changed
1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -42,11 +42,11 @@ when creating your GraphQL schema use [Graphiti](https://github.com/GraphQLSwift
42
42
Once a schema has been defined queries may be executed against it using the global ` graphql ` function:
43
43
44
44
``` swift
45
- let result = try graphql (
45
+ let result = try await graphql (
46
46
schema : schema,
47
47
request : " { hello }" ,
48
48
eventLoopGroup : eventLoopGroup
49
- ). wait ()
49
+ )
50
50
```
51
51
52
52
The result of this query is a ` GraphQLResult ` that encodes to the following JSON:
@@ -94,9 +94,9 @@ let schema = try GraphQLSchema(
94
94
To execute a subscription use the ` graphqlSubscribe ` function:
95
95
96
96
``` swift
97
- let subscriptionResult = try graphqlSubscribe (
97
+ let subscriptionResult = try await graphqlSubscribe (
98
98
schema : schema,
99
- ). wait ()
99
+ )
100
100
// Must downcast from EventStream to concrete type to use in 'for await' loop below
101
101
let concurrentStream = subscriptionResult.stream ! as! ConcurrentEventStream
102
102
for try await result in concurrentStream.stream {
You can’t perform that action at this time.
0 commit comments