Skip to content

Conversation

@jerelmiller
Copy link
Member

@jerelmiller jerelmiller commented Oct 13, 2025

Closes apollographql/apollo-feature-requests#452
Closes apollographql/apollo-feature-requests#358

Add support for lists with useFragment, useSuspenseFragment, and client.watchFragment.

const result = useFragment({
  fragment,
  from: [item1, item2]
});

console.log(result); // { data: [{...}, {...}], dataState: "complete", complete: true }

@changeset-bot
Copy link

changeset-bot bot commented Oct 13, 2025

🦋 Changeset detected

Latest commit: ca42b1f

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@apollo-librarian
Copy link

apollo-librarian bot commented Oct 13, 2025

✅ Docs preview ready

The preview is ready to be viewed. View the preview

File Changes

0 new, 11 changed, 0 removed
* (developer-tools)/react/(latest)/caching/cache-configuration.mdx
* (developer-tools)/react/(latest)/data/fragments.mdx
* (developer-tools)/react/(latest)/data/mutations.mdx
* (developer-tools)/react/(latest)/data/persisted-queries.mdx
* (developer-tools)/react/(latest)/data/queries.mdx
* (developer-tools)/react/(latest)/development-testing/testing.mdx
* (developer-tools)/react/(latest)/integrations/react-native.mdx
* (developer-tools)/react/(latest)/migrating/apollo-client-4-migration.mdx
* (developer-tools)/react/(latest)/performance/server-side-rendering.mdx
* (developer-tools)/react/(latest)/VERSIONING_POLICY.md
* (developer-tools)/react/(latest)/versioning-policy.md

Build ID: 563c651f514a9a36985692d7
Build Logs: View logs

URL: https://www.apollographql.com/docs/deploy-preview/563c651f514a9a36985692d7

@pkg-pr-new
Copy link

pkg-pr-new bot commented Oct 13, 2025

npm i https://pkg.pr.new/apollographql/apollo-client/@apollo/client@12971

commit: ca42b1f

@jerelmiller jerelmiller changed the title Add list support to useFragment, useSuspenseFragment, and client.watchFragment Add array support to useFragment, useSuspenseFragment, and client.watchFragment Oct 23, 2025
link: ApolloLink.empty(),
});

const observable = client.watchFragment({
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we complete the observable if its the from: null observable?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants