brysgo / graphql-gun

A graphql API for the gun p2p graph database
405 stars 20 forks source link

Offline for react web app and react native mobile app #14

Open witbybit opened 7 years ago

witbybit commented 7 years ago

If I use graphql-gun with Apollo client for web (react) and mobile (react-native), will my apps work offline? Is https://github.com/staltz/gun-asyncstorage required here?

brysgo commented 7 years ago

@nikhilag - You will probably need gun-asyncstorage for react-native. Let me know if you run into any issues.

witbybit commented 7 years ago

Do I need to figure out how to use gun-asyncstorage along with Apollo?

brysgo commented 7 years ago

graphql-gun has an apollo style container (https://github.com/brysgo/graphql-gun/issues/3), but as for how that fits into apollo client, I'm not really sure because I haven't had much experience working with apollo.

witbybit commented 7 years ago

Thanks @brysgo ! Basically Apollo and Relay both don't have offline support yet. And I really wanted to figure out if I could use react-native with graphql-gun and get offline support. Seems there is no solution for this currently. I will try using gun-asyncstorage directly. Honestly I am a little confused about how does graphql-gun work offline even for web client since Relay and Apollo don't support offline.

brysgo commented 7 years ago

Graphql gun has no dependency on relay or Apollo client (though it uses tools from Apollo). It basically just mimicks them using gun db which is an offline first DB.