Skip to content

Commit

Permalink
Add documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
BobaFetters committed Nov 21, 2023
1 parent 2659c4c commit 6922036
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions apollo-ios/Sources/Apollo/GraphQLResult.swift
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ extension GraphQLResult: Equatable where Data: Equatable {
extension GraphQLResult: Hashable where Data: Hashable {}

extension GraphQLResult {

/// Converts a ``GraphQLResult`` into a basic JSON dictionary for use.
///
/// - Returns: A `[String: Any]` JSON dictionary representing the ``GraphQLResult``.
public func asJSONDictionary() -> [String: Any] {
var dict: [String: Any] = [:]
if let data { dict["data"] = convert(value: data.__data) }
Expand Down

0 comments on commit 6922036

Please sign in to comment.