I am starting to get into the graphql world using AppSync. I had a working api that stored my data with the following technologies:

  • React
  • Apollo
  • Typescript

Unfortunately, i added some other functionality and it stopped to store new data. I am trying to figure out why. I think I can start by understanding what does actually 'Symbol(isOptimistic): false' mean. Thank you in advance.

1

There are 1 best solutions below

0
On BEST ANSWER

isOptimistic is a flag that you can use as part of an Apollo Client (full documentation).

It's a way of making your UI appear more responsive by assuming that your mutation works.

For example, is you called addComment, an optimistic response immediately add the comment in the client application and then waits for the backend to confirm that the mutation was successful. If it wasn't successful then the client can rollback and error accordingly.

This approach is based on the observation that for some patterns (especially when client validation is used) most mutations succeed.

n.b. Symbol(isOptimistic): false | true is just the type definition indicating that the value can either be true or false.