File tree Expand file tree Collapse file tree
Sources/GraphQL/Execution Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -201,26 +201,13 @@ public func execute(
201201 }
202202
203203 do {
204- // var executeErrors: [GraphQLError] = []
205204 let data = try await executeOperation (
206205 exeContext: buildContext,
207206 operation: buildContext. operation,
208207 rootValue: rootValue
209208 )
210- var dataMap : Map = [ : ]
211-
212- for (key, value) in data {
213- dataMap [ key] = try map ( from: value)
214- }
215-
216- var result : GraphQLResult = . init( data: dataMap)
217-
218- if !buildContext. errors. isEmpty {
219- result. errors = buildContext. errors
220- }
221-
222- // executeErrors = buildContext.errors
223- return result
209+ let dataMap = try Map ( data. mapValues { try map ( from: $0) } )
210+ return GraphQLResult ( data: dataMap, errors: buildContext. errors)
224211 } catch let error as GraphQLError {
225212 return GraphQLResult ( errors: [ error] )
226213 } catch {
You can’t perform that action at this time.
0 commit comments