Skip to content

Commit 1a8dc8a

Browse files
fix: Default execute supports dictionaries
1 parent 600357f commit 1a8dc8a

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

Sources/GraphQL/Execution/Execute.swift

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1198,6 +1198,14 @@ func defaultResolve(
11981198
let value = subscriptable[info.fieldName]
11991199
return eventLoopGroup.next().makeSucceededFuture(value)
12001200
}
1201+
if let subscriptable = source as? [String: Any] {
1202+
let value = subscriptable[info.fieldName]
1203+
return eventLoopGroup.next().makeSucceededFuture(value)
1204+
}
1205+
if let subscriptable = source as? OrderedDictionary<String, Any> {
1206+
let value = subscriptable[info.fieldName]
1207+
return eventLoopGroup.next().makeSucceededFuture(value)
1208+
}
12011209

12021210
let mirror = Mirror(reflecting: source)
12031211
guard let value = mirror.getValue(named: info.fieldName) else {

0 commit comments

Comments
 (0)