@@ -45,8 +45,7 @@ Once a schema has been defined queries may be executed against it using the glob
45
45
``` swift
46
46
let result = try await graphql (
47
47
schema : schema,
48
- request : " { hello }" ,
49
- eventLoopGroup : eventLoopGroup
48
+ request : " { hello }"
50
49
)
51
50
```
52
51
@@ -59,7 +58,7 @@ The result of this query is a `GraphQLResult` that encodes to the following JSON
59
58
### Subscription
60
59
61
60
This package supports GraphQL subscription, but until the integration of ` AsyncSequence ` in Swift 5.5 the standard Swift library did not
62
- provide an event-stream construct. For historical reasons and backwards compatibility, this library implements subscriptions using an
61
+ provide an event-stream construct. For historical reasons and backwards compatibility, this library implements subscriptions using an
63
62
` EventStream ` protocol that nearly every asynchronous stream implementation can conform to.
64
63
65
64
To create a subscription field in a GraphQL schema, use the ` subscribe ` resolver that returns an ` EventStream ` . You must also provide a
@@ -70,7 +69,7 @@ let schema = try GraphQLSchema(
70
69
subscribe : GraphQLObjectType (
71
70
name : " Subscribe" ,
72
71
fields : [
73
- " hello" : GraphQLField (
72
+ " hello" : GraphQLField (
74
73
type : GraphQLString,
75
74
resolve : { eventResult, _ , _ , _ , _ in // Defines how to transform each event when it occurs
76
75
return eventResult
@@ -116,7 +115,7 @@ The example above assumes that your environment has access to Swift Concurrency.
116
115
117
116
## Encoding Results
118
117
119
- If you encode a ` GraphQLResult ` with an ordinary ` JSONEncoder ` , there are no guarantees that the field order will match the query,
118
+ If you encode a ` GraphQLResult ` with an ordinary ` JSONEncoder ` , there are no guarantees that the field order will match the query,
120
119
violating the [ GraphQL spec] ( https://spec.graphql.org/June2018/#sec-Serialized-Map-Ordering ) . To preserve this order, ` GraphQLResult `
121
120
should be encoded using the ` GraphQLJSONEncoder ` provided by this package.
122
121
@@ -140,7 +139,7 @@ To format your code, install `swiftformat` and run:
140
139
141
140
``` bash
142
141
swiftformat .
143
- ```
142
+ ```
144
143
145
144
Most of this repo mirrors the structure of
146
145
(the canonical GraphQL implementation written in Javascript/Typescript)[ https://github.com/graphql/graphql-js ] . If there is any feature
0 commit comments