Can I use GraphQL with a standalone mobile database, such as SQLite or PouchDB

I am looking at Relay / GraphQL. Great for use with React, but my main problem is whether GraphQL can be used offline. In my hybrid app currently built using the Ionic Framework (based on AngularJs), I plan to upgrade to React, Redux. As for fetching data from the server, Relay / GraphQL looks great, but how can I run a GraphQL instance locally on mobile devices when the user is disconnected? Is this a valid use case for Relay / GraphQL. Today I use PouchDB as my local database.

+6
source share
1 answer

There was only one offline update on Blogpost 2015-08-11

https://facebook.imtqy.com/react/blog/2015/08/11/relay-technical-preview.html

What's next:

Offline support. This will allow applications to perform requests and queue updates without connecting.

I would use WebSocket to check if it is on the Internet and show some kind of notification offline. Just do not follow up with battery life. If you want to improve UX, try creating an abstraction layer to save the latest data + mutations and push the update to the server when a connection is established.

React Conf will be 2016-June https://www.react-europe.org/ I think they will do this before this date and announce at conf or earlier, but this is just my personal opinion.

+3
source

All Articles