Skip to content

How to use writeFragment? #2098

Answered by JoviDeCroock
cevr asked this question in Q&A
Nov 24, 2021 · 1 comments · 5 replies
Discussion options

You must be logged in to vote

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:

  cache.writeFragment(
    gql`
      fragment _ on CaseManagementEvent {
        id
        cases { id status __typename }
      }
    `,
    {
      id: variables.eventId,
      cases: [{ ...result.createCaseFromEvent, __typeneame: 'Case' }]
    },
  );

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@cevr
Comment options

@JoviDeCroock
Comment options

@cevr
Comment options

@JoviDeCroock
Comment options

@cevr
Comment options

Answer selected by kitten
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants