artsy / metaphysics

Artsy's GraphQL API
MIT License
360 stars 89 forks source link

feat(EMI-2052): avoid returning lotWatcherCount for closed lots #5997

Closed fladson closed 4 days ago

fladson commented 1 week ago

https://artsyproduct.atlassian.net/browse/EMI-2052

~Return null instead of 0 for the artwork.collectorSignals.auction.lotWatcherCount if the lot is closed for bidding. I got the lot closed logic from the current lotClosesAt field, so any feedback is welcome on that.~

Return no auction data if the lot is closed for bidding.

@artsy/emerald-devs

erikdstock commented 5 days ago

No need to block this further before merging. I would suggest that we make collectorSignals.auction completely null if the resolver isBiddingClosed variable is true - no need to return the variable at all. There could be some debate over whether we should include lotClosesAt in the object - since we have already calculated it, redoing it later in the property resolver seems like it could become a source of a bug even though it seems more conventional.

This approach also avoids the breaking change in the schema.