neo4j-graphql-js
neo4j-graphql-js copied to clipboard
Generate resolvers for relationship types
Related to a discussion with Will, if I write a type like this:
type UPVOTE @relation(name: "UPVOTE") {
from: User!
to: Response!
}
It would be nice to have a resolver for this auto-generated as well. This requires that the 'from/to' property naming be respected. (Related issue: https://github.com/neo4j-graphql/neo4j-graphql-js/issues/235 was a mis-understanding of how this is generated currently)
Every relationship acts as a "pre-join" of sorts. By generating resolvers, certain queries become very easy:
{
BUYS {
from {
name
}
to {
name
}
}
}
A different tack at this by starting from user and navigating to product would of course still be possible, but in some cases I think to go at it "relationship first", and they're easy enough to auto-generate
https://github.com/neo4j-graphql/neo4j-graphql-js/issues/608