metaphysics
metaphysics copied to clipboard
Better use of available data instead of making unnecessary requests
In many cases we blindly fetch an object from Gravity instead of using an already available embedded result that might be present. Currently we sometimes "optimize" for this by passing shallow: true
where we can be sure of an existing embedded result: https://github.com/artsy/metaphysics/blob/f17563ec3c62190594678999864385ae90b9398c/schema/artwork/index.js#L256-L267
However it's likely possible to make this optimization automatically by inspecting the query and available data.
This sounds like a good idea, but as is always the case with optimisation, I’d first like to know how much impact this would actually have in our case.