Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(graphcache): support passing in name for fragments #2609

Merged
merged 6 commits into from
Aug 15, 2022

Conversation

JoviDeCroock
Copy link
Collaborator

Resolves #2566

Summary

When re-using document-nodes that contain queries/multiple fragments we might need to target a fragment rather than going for the first one. This PR introduces a new argument named fragmentName which allows people to target a specific FragmentDefinitionNode in a DocumentNode by name.

Set of changes

  • add fragmentName argument to write and read operations

@JoviDeCroock JoviDeCroock requested a review from kitten August 15, 2022 07:35
@changeset-bot
Copy link

changeset-bot bot commented Aug 15, 2022

🦋 Changeset detected

Latest commit: 4ddd0ae

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

This PR includes changesets to release 1 package
Name Type
@urql/exchange-graphcache Minor

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

@github-actions github-actions bot temporarily deployed to staging-2609 August 15, 2022 07:37 Inactive
@JoviDeCroock JoviDeCroock merged commit 600c7b9 into main Aug 15, 2022
@JoviDeCroock JoviDeCroock deleted the support-passing-in-name branch August 15, 2022 13:08
@urql-ci urql-ci mentioned this pull request Aug 15, 2022
@narkeeso
Copy link

I just noticed this, thank you for this feature. We have a lot of fragments that will benefit from this. I think it also helps people understand how the fragment is targeted. Thank you 🙏

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.

(graphcache)- readFragment targets the first fragment of a DocumentNode
3 participants