@@ -45,8 +45,7 @@ Once a schema has been defined queries may be executed against it using the glob
4545``` swift
4646let result = try await graphql (
4747 schema : schema,
48- request : " { hello }" ,
49- eventLoopGroup : eventLoopGroup
48+ request : " { hello }"
5049)
5150```
5251
@@ -59,7 +58,7 @@ The result of this query is a `GraphQLResult` that encodes to the following JSON
5958### Subscription
6059
6160This 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
6362` EventStream ` protocol that nearly every asynchronous stream implementation can conform to.
6463
6564To 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(
7069 subscribe : GraphQLObjectType (
7170 name : " Subscribe" ,
7271 fields : [
73- " hello" : GraphQLField (
72+ " hello" : GraphQLField (
7473 type : GraphQLString,
7574 resolve : { eventResult, _ , _ , _ , _ in // Defines how to transform each event when it occurs
7675 return eventResult
@@ -116,7 +115,7 @@ The example above assumes that your environment has access to Swift Concurrency.
116115
117116## Encoding Results
118117
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,
120119violating the [ GraphQL spec] ( https://spec.graphql.org/June2018/#sec-Serialized-Map-Ordering ) . To preserve this order, ` GraphQLResult `
121120should be encoded using the ` GraphQLJSONEncoder ` provided by this package.
122121
@@ -140,7 +139,7 @@ To format your code, install `swiftformat` and run:
140139
141140``` bash
142141swiftformat .
143- ```
142+ ```
144143
145144Most of this repo mirrors the structure of
146145(the canonical GraphQL implementation written in Javascript/Typescript)[ https://github.com/graphql/graphql-js ] . If there is any feature
0 commit comments