Closed patrick91 closed 4 months ago
Hi @patrick91 👋 miss you! A way to identify the entity object in the cache is needed for useFragment
. See https://www.apollographql.com/docs/react/api/react/hooks#usefragment, specifically, the from
attribute. So if you can identify a fragment by its type and an id
, that's probably the most straightforward way. But if there are other valid identifiers that could be used (in combination with keyFields
) then that should work too. Hope that helps!
@bignimbus I was pretty tired when I was trying the useFragment
hook, and I was expecting something more magic.
I've ended up using fragments, but passing the data down directly to the component using the fragment, since I don't have a unique identifier for the flyers field 😊
Do you have any feedback for the maintainers? Please tell us by taking a one-minute survey. Your responses will help us understand Apollo Client usage and allow us to serve you better.
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. For general questions, we recommend using StackOverflow or our discord server.
Hi, I'm trying
useFragment
with a query that looks like this:I'd like to split the query this way:
but it doesn't seem to work 😊 Is my understanding correct that
useFragment
"only" works with types that have an ID?