feature-sliced / documentation

🍰 Architectural methodology for frontend projects
https://feature-sliced.design
MIT License
1.47k stars 152 forks source link

HOWTO: Recipes for working with GraphQL or normalization [cache, normalizers, repositories] #463

Open SuperOleg39 opened 2 years ago

SuperOleg39 commented 2 years ago

At the moment, the documentation does not answer the question of which layer might be responsible for distributing data from the API to the different entities

azinit commented 2 years ago

@SuperOleg39 thanks for issue!

Could you please specify some details?

"which layer might be responsible for distributing data from the API to the different entities"

1) For GraphQL - there is usually responsible for-cache client (e.g. ApolloClient) Thus any API-request will be distributed to "entities" automatically with this cache-client, won't it? And the question is, what exactly would you like to see in the documentation with GraphQL?

2) For normalization in general Would you like to see dataflow recommendations like these?

SuperOleg39 commented 2 years ago

Good point for GraphQL, i did not think about the fact that the results of the query do not need to be stored somewhere else.

About normalization, both of recommendations sounds very useful!

azinit commented 2 years ago

Good point for GraphQL, i did not think about the fact that the results of the query do not need to be stored somewhere else.

Yeah, we'll try to describe it in documentation, but at least we have representive GraphQL example https://github.com/ani-team/github-client/tree/workshop/feature-sliced-next

About normalization, both of recommendations sounds very useful!

Good! At the moment @RinAkaia is writing article about "Entities normalization" And we will do everything possible to make this article appear sooner

But while waiting for the article, you can look up these materials:

SuperOleg39 commented 2 years ago

Thanks you very much! Will be waiting for a new article)