Skip to content
This repository has been archived by the owner on Sep 15, 2020. It is now read-only.

implement a graphql interface for a holochain backend #770

Open
DrewMcArthur opened this issue Aug 4, 2018 · 1 comment
Open

implement a graphql interface for a holochain backend #770

DrewMcArthur opened this issue Aug 4, 2018 · 1 comment

Comments

@DrewMcArthur
Copy link

possibly a project for a separate repo, but would be really cool.

As I understand it, this is the database software for a decentralized/distributed app, right? So if I have an app that currently interacts with the backend through graphql, then it would be incredible to be able to reconstruct the original 'tables' (possibly a different name for this) in the holochain backend (to store info on users, posts, etc.), and then simply point the front end to the new api endpoint that would be the local graphql server interfacing with holochain.

my initial thoughts would be a local process that accepts graphql queries and routes them to appropriate functions to access data stored in the holochain. the holochain would still be configured separately, but this would allow dApps to interface with the holochain backend through graphql clients such as Apollo.

graphql reference:
* website
* wikipedia page
* github
* cool video explaining it (14 min)

@sqykly
Copy link

sqykly commented Nov 16, 2018

I'm no guru at holochain, but no, it's not a DB or really anything like it. No one is making any queries, even server side, in the way you would expect from a DB. The web-facing API is REST-y, but not 100% like a lot of RESTs I have seen. You have a static server and a fixed set of functions defined by the app. This is all relevant to the Go prototype only; I've been told that the Rust alpha has more flexibility.

If I understand GraphQL at all (and I really don't, to be honest), on the client side, it gets you the right data by trimming extraneous properties and/or making multiple requests, correct? That is going to be difficult if it it's set up to make requests for specific data. A Holochain app doesn't do things free-form; there are a fixed number of entry points to the app web API, so the developers would need to specifically plan for those types of requests. On the server side, it's difficult for me to imagine a general purpose solution without forcing the developers again to design their whole app around the GraphQL service.

From the way I hear people talk about GraphQL alone, I can tell that someone will find that reasonable and do it before too long. Or we will leave the Go prototype behind for the Rust alpha, which will probably make the idea a piece of cake.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants