-
Notifications
You must be signed in to change notification settings - Fork 89
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
chore: consistent artwork money fields resolver #6367
base: main
Are you sure you want to change the base?
Conversation
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.
This looks great to me. Thanks @erikdstock !
@@ -676,7 +676,7 @@ describe("Artwork type", () => { | |||
minPrice: { | |||
minor: 42000, | |||
major: 420, | |||
display: null, | |||
display: "US$420", |
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.
❤️
resolve: (artwork) => { | ||
const { price_paid_cents } = artwork | ||
resolve: async (artwork, args, ctx, info) => { | ||
const { price_paid_cents, price_paid_currency = "USD" } = artwork |
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.
Slightly surprised that we ask collectors to enter price in cents, but I guess it was here already.
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.
It is probably calculated on the artwork from some input using the money helper gem
return ( | ||
moneyFields && { | ||
...moneyFields, | ||
// TODO: Display field legacy implementation maintained until we verify |
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.
Should we create a separate card for this?
Now wondering if I should use the |
Good point @erikdstock. Think we should generate the same string as gets added for SippingInfo below in the same file: metaphysics/src/schema/v2/artwork/index.ts Line 1426 in 6a3126a
|
Downstream from some hackathon work... This PR updates our artwork and editionSet fields to use a consistent resolver for the money type, avoiding missing display values.
In order to preserve some behavior I clobbered that display value on one field where we are using the gravity
price_display
json value instead. There might be other cases where we want to verify that nothing is changing drastically - for example, are we querying anydisplay
fields where the format is hardcoded.cc @artsy/emerald-devs