metaphysics icon indicating copy to clipboard operation
metaphysics copied to clipboard

Better use of available data instead of making unnecessary requests

Open dzucconi opened this issue 8 years ago • 1 comments

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.

dzucconi avatar Jun 21 '16 19:06 dzucconi

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.

alloy avatar Dec 06 '16 20:12 alloy