Learn Relay
/
01 · Fetch GraphQL
02 · useLazyLoadQuery
03 · useFragment
04 · usePaginationFragment
05 · useMutation
06 · Mutation updater
07 · useRefetchableFragment
08 · useSubscription
09 · usePreloadedQuery
10 · test usePreloadedQuery
11 · test useFragment
12 · test useMutation
13 · Declarative directives
14 · Optimistic updates
15 · Fetch policies & refreshing
16 · The Relay store: local updates
17 · @required & error boundaries
← 06
08 →
▶ Run
✓ Check
learn
code
preview
comment/PostComments.tsx
App.tsx
Feed.tsx
Post.tsx
+ 15 more files
ErrorBoundaryRetry.tsx
Loading.tsx
Providers.tsx
Root.tsx
comment/PostCommentComposer.tsx
comment/PostCommentCreateMutation.tsx
comment/UserAvatar.tsx
config.tsx
index.tsx
like/PostLikeButton.tsx
like/PostLikeMutation.tsx
like/PostUnLikeMutation.tsx
relay/Environment.tsx
relay/fetchGraphQL.tsx
relay/getToken.tsx
auto run
reset
Loading editor…
localhost:7500 · in-browser GraphQL server
latency
0ms
300ms
800ms
2000ms
Checks
Network
Relay Store
Console
Checks verify your solution against the running app.
✓ Check my solution
○
PostComments uses useRefetchableFragment
○
PostComments_post fragment is @refetchable
○
useTransition is used to refetch
○
Clicking "Show older" refetches the fragment and renders more comments