-
Notifications
You must be signed in to change notification settings - Fork 731
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fatal error ("Optional is only JSONEncodable if Wrapped is") when trying to update SqlNormalizedCache manually after a successful mutation operation #1305
Comments
The problem definitely seems to be in the fact that the value type in the dictionary is Does it work to typealias it to |
I'll test that here shortly and report back. |
@nateirwin Were you ever able to get this tested out? |
@designatednerd: I started to dive into this, ran into a minor issue (that's project-specific and I just need to push through), then got pulled into another issue altogether. This is still critical for our project and it's next on my list, so I'll get to it soon. I'm happy to close this and re-open when I've had the chance to test, if that's helpful. |
Nah, leave it open for now, I'll keep annoying you about it from time to time 😇 |
Ok, reporting back :-) Switching the typealias to
I'm guessing maybe it's bonking on the |
Hm, shouldn't be bonking on nulls, we've got something that theoretically should be handling that. From the underlying error it looks like it's freaking out about the I think a bigger question this brings up is why this data needs to be returned as an arbitrary JSON blob in the first place - why isn't this data returned as something typed? |
Well,
That's why I'm scratching my head about this. Maybe my next step is setting some more breakpoints in JSONStandardTypeConversions.swift? |
Looking at the JSON, |
Sure, here you go (sorry about the delay):
|
Ah, ok, One thing it didn't occur to me to ask: Is your |
It is getting hit, and it's throwing when that same |
Here's a thought - have you got an extension that implements |
Aha, that is indeed implemented in the library. OK, I'll mess around with this some to try and figure out what's going on here. |
Thanks for your help! |
@nateirwin please try pulling the branch #1317 is opened from and seeing if that fixes your issue. You can put the |
Yep, that fixes the issue!!! |
This has shipped with |
While using Apollo iOS 0.29.1, I appear to be running into an issue similar to the one reported here. I asked for help with this issue in Spectrum, and @designatednerd asked me to create a new issue.
I'm trying to update the SqlNormalizedCache (which is setup and working properly) using the result of a successful mutation operation:
This is throwing a fatal error in "JSONStandardTypeConversions.swift" at line 109:
Printing the description of
self
:In this case,
self
is a property on theresponse
property, which is a customjsonb
type. Here's the type alias:And here's the query:
The mutation:
And, finally, the fragment that's used by both the query and the mutation:
The text was updated successfully, but these errors were encountered: