metaphysics icon indicating copy to clipboard operation
metaphysics copied to clipboard

Add additional content and followable checks to home page artwork modules

Open sarahscott opened this issue 8 years ago • 7 comments

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:

screen shot 2016-08-12 at 5 41 37 pm

So fields like has_additional_content and followable would be nice. Maybe is_followed_by_user too.

sarahscott avatar Aug 12 '16 15:08 sarahscott

@alloy thoughts on this issue appreciated!

sarahscott avatar Aug 12 '16 15:08 sarahscott

@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 avatar Aug 12 '16 15:08 broskoski

@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 avatar Aug 12 '16 15:08 sarahscott

@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?

alloy avatar Aug 13 '16 23:08 alloy

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.

sarahscott avatar Aug 15 '16 13:08 sarahscott

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.

alloy avatar Aug 22 '16 10:08 alloy

@sarahscott @broskoski what are your thoughts on this nowadays?

alloy avatar Jan 06 '17 15:01 alloy