How to use writeFragment? #2098
-
Im using writeFragment to update a row in a list I'm displaying. The fragment reads correctly, but it doesn't seem to be propagating the update when I try to write. https://gist.github.com/cevr/9ab1fe498ba8383d13fab8c7aaca26c8 The event is never updated. Am I missing something? |
Beta Was this translation helpful? Give feedback.
Answered by
JoviDeCroock
Nov 24, 2021
Replies: 1 comment 5 replies
-
Have you tried adding So: cache.writeFragment(
gql`
fragment _ on CaseManagementEvent {
id
cases { id status __typename }
}
`,
{
id: variables.eventId,
cases: [{ ...result.createCaseFromEvent, __typeneame: 'Case' }]
},
); |
Beta Was this translation helpful? Give feedback.
5 replies
Answer selected by
kitten
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Have you tried adding
cases
to your fragment, else it won't be able to write 😅 it uses the fields in your fragment to know what you want it to write.So: