facebook / facebook/relay

[Modern] mutation underfetching/overfetching

Open
#1,995 23 comments 21 reactions 0 assignees View on GitHub
docs wontfix
Dominant language
Rust
Stars
19k
Forks
1.9k
PR merge metrics
No merged PRs in 30d

Description

I know that concept of fatQuery is not in modern. But I struggle how to organize the schemas in mutations to make sure I am not under/over fetching. When some object is just updated, its safe just to ask for everything that might have changed.. and thats fine most of the time - in worst case its just some overfetching.

But what if new object is added to the list? How do I know which components are using which fields? And what happens if I don't fetch all relevant fields which some component requires - does it show broken data or somehow refetch?

What strategy you use, just ask always for all fields to avoid under fetching?

Sorry not posting this on SO, but I think its actionable and eventually should be closed with some documentation PR.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.