-
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
MBL-1344: Fix sort for backer dashboard by upgrading V1 query to GraphQL #2034
MBL-1344: Fix sort for backer dashboard by upgrading V1 query to GraphQL #2034
Conversation
…Query and FetchMySavedProjectsQuery
@@ -1,8 +1,21 @@ | |||
import Foundation | |||
|
|||
public enum ProfileProjectsType: Decodable { |
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.
Moved this here so it could be part of the envelope.
return SignalProducer(value: envelope) | ||
} | ||
|
||
static func fetchProjectsEnvelope(from data: GraphAPI.FetchMySavedProjectsQuery.Data) |
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.
Basically the same as above but shaped slightly differently for the different response.
@@ -0,0 +1,17 @@ | |||
query FetchMyBackedProjects($first: Int = null, $after: String = null, $withStoredCards: Boolean = false) { | |||
me { | |||
backingsCount |
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.
n.B. that this one uses backingsCount
on me
whereas the other query uses totalCount
on pageInfo
. totalCount
for whatever reason is deprecated here.
Generated by 🚫 Danger |
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.
Nice!
/* | ||
This is a very large response object, so load it from a file instead of putting it inline here. | ||
These are very large response object, so load it from a file instead of putting it inline 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.
nit: object
should be objects
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.
Ha, will fix
📲 What
Upgrade the V1 API query on our backer dashboard page to GraphQL to fix its sort. This uses a similar GraphQL query to what we use on the web - querying the
me
object to get backed and saved projects.🤔 Why
Late pledges were being shown based on the project end date, instead of by what was most recently backed. This special sort is only available on
me { backedProjects }
.👀 See
Before:
After:
Compare with what I see on web:
On production, I see no difference between before-and-after; I think the effect is much more dramatic on staging because of our dubious data there.