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 @@ -183,26 +183,13 @@ public func execute(
183183 }
184184
185185 do {
186- // var executeErrors: [GraphQLError] = []
187186 let data = try await executeOperation (
188187 exeContext: buildContext,
189188 operation: buildContext. operation,
190189 rootValue: rootValue
191190 )
192- var dataMap : Map = [ : ]
193-
194- for (key, value) in data {
195- dataMap [ key] = try map ( from: value)
196- }
197-
198- var result : GraphQLResult = . init( data: dataMap)
199-
200- if !buildContext. errors. isEmpty {
201- result. errors = buildContext. errors
202- }
203-
204- // executeErrors = buildContext.errors
205- return result
191+ let dataMap = try Map ( data. mapValues { try map ( from: $0) } )
192+ return GraphQLResult ( data: dataMap, errors: buildContext. errors)
206193 } catch let error as GraphQLError {
207194 return GraphQLResult ( errors: [ error] )
208195 } catch {
You can’t perform that action at this time.
0 commit comments