prisma1 icon indicating copy to clipboard operation
prisma1 copied to clipboard

Optional delta updates?

Open thevishnupradeep opened this issue 9 years ago • 5 comments

I tried to use Graphcool with the current project I am working on but decided against it because it was an offline first app. It would be so much easier to create an offline first experience if we could get only changed data from the database.

thevishnupradeep avatar Jul 29 '17 17:07 thevishnupradeep

Hey, thanks for this suggestion :wave:

Offline support is a topic discussed heavily in the GraphQL ecosystem currently. See this recent article for example: http://www.east5th.co/blog/2017/07/24/offline-graphql-queries-with-redux-offline-and-apollo/

Did you do some research in that direction already, for example with redux-persist?

marktani avatar Jul 29 '17 20:07 marktani

Using subscriptions is another way to only get updated data from the database, although it would require an active connection though.

kbrandwijk avatar Aug 02 '17 20:08 kbrandwijk

We could approach it in the normal database kind of way. Timestamp of last update is sent along with new data from device to the server. All new updates after the time stamp will be sent to the device as a response and merged with persisted data.

The database will need to have a last updated row with the each document for this to work.

thevishnupradeep avatar Aug 05 '17 09:08 thevishnupradeep

The database already has a 'updatedAt' field on each Type. If you keep the value of that field from your last query on the client, you can always filter your query on that field using updatedAt_gt.

kbrandwijk avatar Aug 05 '17 14:08 kbrandwijk

This issue has been moved to graphcool/graphcool-framework.

marktani avatar Jan 23 '18 15:01 marktani