artsy / metaphysics

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

fix(WIP): Do not allow setting MyC artwork condition to Null in mutations #6015

Closed olerichter00 closed 1 month ago

olerichter00 commented 1 month ago

Related to https://github.com/artsy/eigen/pull/10785

Description

With this, we don't allow setting MyC artwork's condition to null in mutations because it's not allowed in Gravity and we're getting an error message that null is not allowed when we try to.

This is fix is related to https://github.com/artsy/eigen/pull/10785.

nickskalkin commented 1 month ago

I read this as condition can be nil.

At least I can do this in console:

w = Artwork.find("667d740df781c9070ddcc63d")
w.condition = nil
w.save!

Could it be that there is an issue with how metaphysics sends null condition (when I pass condition: null in mutation payload - MP fires such request to gravity "artwork/667d740df781c9070ddcc63d?condition=")? Or something is wrong on gravity's endpoint side?

olerichter00 commented 1 month ago

@nickskalkin, yeah, probably it's not about setting condition to null, but how the null is passed from the client through MP to Gravity. Maybe it is cast to a string or somewhere in between.