-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
[NT-732] Consume category name from v1 API #1057
Conversation
KsApi/models/Category.swift
Outdated
self.subcategories = try? values.decode(SubcategoryConnection.self, forKey: .subcategories) | ||
self.totalProjectCount = try? values.decode(Int.self, forKey: .totalProjectCount) | ||
} | ||
|
||
/* Tries to decode the parent category from the expected GraphQL structure |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure how I'm feeling about this. It seems to work but I'm going to take another look tomorrow at what would be involved to just split these two models out completely.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, started down a different path and don't really feel like using separate models would be significantly better. Let me know what you think @Scollaco @ifbarrera.
# Conflicts: # Library/OptimizelyClientType.swift
KsApi/lib/TryDecodable.swift
Outdated
import Argo | ||
import Foundation | ||
|
||
public func tryDecodable<T: Swift.Decodable>(_ json: JSON) -> Argo.Decoded<T> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we planning to use this in the future? It seems that it's not being used currently.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah good call out! I know we don't typically like to do this (and if you feel strongly, I'll remove it), but given that we have a test for it and it's very much our intention to start deprecating Argo using this function I'd like to get it into the codebase. What if I open a PR tomorrow that uses it to deprecate at least one Argo.Decodable
model? 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A new PR sounds good. I can review it. Good Job here!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So much simpler than before 🙏
📲 What
Improves deserialization of the parent category from our v1 api so that it includes the category name.
🤔 Why
This is information that we would like to include in our tracking properties.
🛠 How
Swift.Decodable
Category
model within ourArgo.Decodable
Project
model.Category
info into aProject.Category
model.tryDecodable(_:)
described in the RFC for deprecating Argo for future use.✅ Acceptance criteria
Category
(discover feed, discover filter).⏰ TODO