react-shopify icon indicating copy to clipboard operation
react-shopify copied to clipboard

Conditionally fetch fields

Open dhmacs opened this issue 7 years ago • 1 comments

This library abstracts away the fetching of data from the user and right now we do it at the cost of sacrificing performances (i.e. we fetch all the data from the storefront api, even the data that the user might actually not need).

This issue is to overcome this limitation by using graphql directives to fetch data based on user needs.

We need to come up with an easy to use API that let's devs who want to improve perfs by reducing request size to do so. It can be something like a blacklist param:

<Collection exclude="variants", "options", "handle">
...
</Collection>

We need to put more thoughts on this.

dhmacs avatar Jun 12 '18 08:06 dhmacs

Starting from v0.7.0 we took a different approach by allowing to specify a product fragment on collection.

I'll leave this issue open as I feel there might be a better way to handle this

dhmacs avatar Oct 10 '18 11:10 dhmacs