Component organization and architecture patterns.
@prepared911/ui in apps and remotes, load the find-pattern, compose-ui, and choose-control agent skills before implementing (see root AGENTS.md). Layout uses Box / FlexBox enum props, not raw <div> / <section> for product chrome.
File size limits:
components/, not shared/<Icon />) instead of render functions (e.g., getIcon()).
Benefits:
FragmentType), not an id and not the raw object. An id makes the child fetch for itself, which means a query below the query root. A raw result object ties the child to the parent's query. The child declares a Message_message fragment, takes message: FragmentType<typeof MessageMessageFragmentDoc>, and reads it with useFragment. See GraphQL Fragments, and Testing a Fragment-Owning Component on Its Own for how to test such a component.
React component files must not exceed 500 lines.
Extract logic to hooks, sub-components, or utilities when approaching this limit.
queries.graphql (any number of queries)mutations.graphqlsubscriptions.graphqlfragments.graphql, with one fragment per component named Component_propuseQuery. A component below it declares a fragment in its own fragments.graphql and reads it with useFragment. See the Fragments guide.
For larger features:
graphql/ folder: Don't create module-level graphql/ foldersUserDashboard query selects id on user and spreads ...UserProfileSection_user and ...PostsSection_user. A section reads its data from its fragment, so it never calls useQuery itself.
Favor small, composable components over "god" components.
error for the component to show. It doesn't report it: the shell's Apollo client reports a network or transport failure once, and the backend has already reported an error it returned in the response (Who reports an error).