-
Notifications
You must be signed in to change notification settings - Fork 72
apollo-server, neo4j-graphql, and schema extraction #40
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
Comments
Thanks for the feedback. As you point out, in its current form neo4j-graphql is more of a replacement for apollo-server than a complementary tool since Neo4j is serving the GraphQL endpoint. We've had similar requests so we're working on a separate library for generating Cypher queries from GraphQL that would work with apollo-server. The Cypher queries are generated on the fly for a given GraphQL query. I don't believe they are currently logged, but we could add support for that. You could also enable query logging in Neo4j to see what queries are being executed |
@johnymontana many thanks! I'll look into the logging for current dev. I'm looking forward to seeing this project advance! |
@johnymontana To work with Apollo GraphQL, do you mean cascading GraphQL endpoint? |
Possibly related: I went looking for one, but can't see where |
it stores it in the graph itself as a graph property, so it's e.g. synched across a cluster. |
@Joshfindit You could just re-post your IDL if you have changes. |
@jexp Sorry, that was a while ago. I wasn't able to get my hands on it deeply enough and couldn't commit to using it for real data so I have no idea what I was working with at that time. Reading back it seems like it might be helpful to share the query that returns the schema. |
I think this issue can be closed. Using apollo-cli, you can download an introspection query of the neo4j auto-generated schema in json form. You can then feed this into Apollo server using makeRemoteExecutableSchema. Using the schema transform functions in graphql-tools, you can merge the Neo4j schema into your ApolloServer schema, the apollo server schema is then smart enough to delegate resolution of fields to Neo4j, as appropriate. This solution also allows you hide Neo4j schema fields from the public UpdateI may have gotten ahead of myself. It turns out one of the major limitations of schema stitching is that you cannot modify the query very much if you are forwarding it to the neo4j-graphql plugin. This is a shame, because it largely eliminates the ability to wrap neo4j fields from the neo4j schema with authorization checks. |
@thefliik it sounds as if there is a blog post from you waiting showing how to do this in detail :) We'd be happy to publish it at blog.grandstack.io but you could also submit it to freecodecamp or hackernoon :) |
posting this as an issue per @jexp request in slack
It would be great if neo4j-graphql and apollo-server would place nice with each other.
Writing schema in neo4j-graphql is a breeze! But apollo-server requires a local version of the schema as well as resolvers. So, one winds up with an impedance mismatch because you can just directly send graphql queries to neo4j via the plugin, which obviates apollo-server's resolvers.
With that in mind...
Does anyone know if you can get the generated cypher queries from the plugin?
Related question, does the plugin generate all the queries and then stores them, or does the plugin just generate the queries on the fly? If the latter, then I expect it wouldn’t be possible to get the queries.
The reason I ask is that I’m working with a backend that is using the apollo-server. It would be nice if the plugin could spit out the queries, which I could then use in the apollo-server resolvers.
Thanks!
The text was updated successfully, but these errors were encountered: