swift-graphql icon indicating copy to clipboard operation
swift-graphql copied to clipboard

NSNull case was handled for nullable selections

Open Sundea opened this issue 2 years ago • 1 comments

Fix for the https://github.com/maticzav/swift-graphql/issues/89

I've found that value of AnyCodable is Optional<Any> - some : in that cases. It's not nil. So, instead of void, we receive a "value" while decoding and decoder fails

(lldb) po value
▿ Optional<Any>
  - some : <null>
 
(lldb) po value == nil
false
@frozen public struct AnyCodable: Codable {
    public let value: Any

    public init<T>(_ value: T?) {
        self.value = value ?? ()
    }
}

But the nullable selection handles only void case

Sundea avatar Sep 14 '22 16:09 Sundea

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
swift-graphql ✅ Ready (Inspect) Visit Preview Sep 14, 2022 at 4:35PM (UTC)

vercel[bot] avatar Sep 14 '22 16:09 vercel[bot]

Sweet, thanks!

maticzav avatar Oct 26 '22 07:10 maticzav