gsans / todo-react

Todo List example using React and Apollo Client
MIT License
10 stars 2 forks source link

no live reload #2

Open Jpowe opened 7 years ago

Jpowe commented 7 years ago

Set this up as instructed with a graph cool account. Todo list is not updating after entry. Only updates after browser refresh.

gsans commented 7 years ago

Thanks for reporting it.

This is the code responsible for updating the todos state after adding the todo https://github.com/gsans/todo-react/blob/master/src/components/TodoApp.js#L55-L65

This should work unless the API has changed recently. Let me know if you find a fix.

Jpowe commented 7 years ago

Thanks for your work!

Adding the following to client.js fixes issue...

dataIdFromObject: o => o.id,

gsans commented 7 years ago

You are welcome. I see. Thanks for sharing! I'll add the fix.