Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lite implementation, ref states and pointers #1

Open
manosbatsis opened this issue Jul 14, 2021 · 3 comments
Open

Lite implementation, ref states and pointers #1

manosbatsis opened this issue Jul 14, 2021 · 3 comments

Comments

@manosbatsis
Copy link
Collaborator

A while back i was thinking about pulling together a quick and dirty impl by making the node's read-only JPA entity manager useful for a change, along with some plumbing based on graphql-jpa-query. It's actually pretty easy to do and might be considered as a "lite" impl in cgraph.

That said, the main reason it never happened is that states don't really have relations and i couldn't think of an easy solution for taking reference states and pointers into account.

@mcevoyinit
Copy link
Owner

mcevoyinit commented Jul 15, 2021

Thanks Manos. That sounds neat. I can see GraphQL connecting and working directly with the node database itself giving users more confidence, in terms of consistency and transactionality, when knowing they are querying the same datastore they are writing to. The buffer between say, the node DB and the likes of dgraph may be acceptable to many use-cases though with reconciliation processes, logging, analysis and whatnot.

One tool I'm looking at is https://hasura.io/ which supports linking the GraphQL server to the likes of Postgres and MySQL.

As far as doing it on a vault level, to arrive at truly seamless vault-graphql API, other than what you are suggesting, I've only seen hibernate-graphql examples like https://github.com/graphql-java/graphql-java-examples/tree/master/hibernate-example

@manosbatsis
Copy link
Collaborator Author

Good point, Hibernate might prove more flexible/able. Standard JPA requires explicitly mapped relationships for anything useful, which is a shame considering how close a pointer reference is to a regular foreign key or other JPA-map-able stuff, with some even based on an ID+classname combo. Will have to look into it.

@manosbatsis
Copy link
Collaborator Author

I was going to quickly patch-up a limited solution with graphql-jpa-query but after doing some research on graphql-java as you suggested, it looks like we should be able to create instances of graphql.schema.DataFetcher to accommodate for state pointers so i'll give it a try and see where it gets us.

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

No branches or pull requests

2 participants