GraphQL - Yoga/Apollo - Schema Augmentation - Cypher Autogenerator
Has anyone tried using RedisGraph with Apollo/Yoga and Neo4j-graphql-js npm module?
Ability to take IDL schema definitions of GraphQL and convert it into Cypher without writing resolvers (you get queries and mutations automatically, plus things like pagination etc)
Would be really cool to bring GraphQL community into RedisGraph. https://grandstack.io/docs/neo4j-graphql-js.html
Perhaps a Yoga POC example with redisgraph on back end and neo4j-graphql-js doing the graphql to cypher conversion? There is also graphql-shield for working with permissions (awesome) as well as graphql-tag for easy graphql queries?
Hi, I too would love auto generated resolvers. Nice idea.
One concern is, the GraphQL libraries are complicated with thousands of lines. How do you de spec this so we can solve it with simple functional programs?
@bionicles extracted from: https://github.com/neo4j-graphql/neo4j-graphql-js (half way readme file)
Create an executable schema with auto-generated resolvers for Query and Mutation types, ordering, pagination, and support for computed fields defined using the @cypher GraphQL schema directive:
import { makeAugmentedSchema } from 'neo4j-graphql-js';
const schema = makeAugmentedSchema({ typeDefs }); Create a neo4j-javascript-driver instance:
import { v1 as neo4j } from 'neo4j-driver';
const driver = neo4j.driver( 'bolt://localhost:7687', neo4j.auth.basic('neo4j', 'letmein') );
there is a neo4j-graph-js and there is neo4j-driver. not a javascript expert at all but this is where i would start. take apart the driver, see what it does and then deliver data to neo4j-graphql-js.
i can setup infrastructure redisgraph db, automated builds, domain, space, containers but i'm not a js specialist.
also as @swilly22 mentioned there are some other graphql to cypher (python-based) generators on the market that just popped up. however there is still massive discrepancy in capability between open-source python projects and well funded neo4j backends. (both neo4j-graphql-js and neo4j-javascript-driver are Apache2.0 projects)
one thing that worries me is that at some point and in difficult situations graphql queries have tendency of falling back on APOC functionsets. But just to get it to a point where simple stuff is working would be great. Maybe eventually neo4j would agree to include RedisGraph and then development could unify and progress from single repo. It would be in everyone's best interest to do so.
Massive amount of knowledge in the neo4j-graphql-js repo. New stuff related to doing filters on relationship properties is totally awesome. I mean from graphql so you can add JWT RBAC protection per schema. Speed-wise you can do jet-propelled circles around RESTful developers and still have time to watch a movie. More people we convince, easier it will get.
I think I explained most of this already in https://github.com/RedisGraph/RedisGraph/issues/347 so this issue slowly becomes a duplicate, but good to have it open so this is visible until actionstep decided.