metaphysics
metaphysics copied to clipboard
Add additional content and followable checks to home page artwork modules
Ideally the response would provide some sort of context for these cases so they don't have to be individually checked for by the client:

So fields like has_additional_content
and followable
would be nice. Maybe is_followed_by_user
too.
@alloy thoughts on this issue appreciated!
@sarahscott for the related content, it might be useful to look at how we handle this on Force.
For instance, an individual module: https://github.com/artsy/force/blob/master/apps/home_2/queries/module.coffee
context
is a GraphQLUnion type that is switched depending on the type of module returned. We use these contexts switches to get additional info on the module (e.g. Auction metadata, Related artist "based on", etc).
For the Related Artists example: https://github.com/artsy/force/blob/master/apps/home_2/components/related_artists_context/query.coffee
Context definitions are here: https://github.com/artsy/metaphysics/blob/master/schema/home/context.js
@broskoski this is super helpful. What about the cases where all works are already provided by results
and the View All button should be hidden? Does it make sense to check each time if more works exist for that particular module?
@sarahscott
Adding is_followed_by_user
and has_additional_content
make sense to me, we need to know if the expand button needs to be shown at render time 👍
I’m not sure what followable
is meant for, though, can you elaborate?
It would be nice to have so I don't have to check every time if the rail needs a follow button (i.e. for a Gene or Artist or Partner vs. Recommended Works), but it could be overkill. I'm just thinking of ways to reduce complexity on the RN side.
It would be nice to have so I don't have to check every time if the rail needs a follow button (i.e. for a Gene or Artist or Partner vs. Recommended Works), but it could be overkill. I'm just thinking of ways to reduce complexity on the RN side.
Oh I see. Hmm, that does feel a bit like overkill, as the switch statement for it would likely be very simple. Let’s keep it in the client for now and review afterwards if the amount of complexity warrants extraction or not.
@sarahscott @broskoski what are your thoughts on this nowadays?