neo4j-graphql / neo4j-graphql-js

NOTE: This project is no longer actively maintained. Please consider using the official Neo4j GraphQL Library (linked in README).
Other
609 stars 147 forks source link

Specifying Cypher version in queries #324

Open neilprosser opened 5 years ago

neilprosser commented 5 years ago

We've hit a situation where we need to be able to to use the ability to specify a Cypher version. After an upgrade to Neo4j 3.5 from 3.4 we hit a major performance regression which resulted in an order of magnitude slowdown of our generated Cypher queries.

We mitigated this by monkey-patching the translateQuery function to prepend CYPHER 3.4 to all translated queries but it would be great to have a proper way to do this properly via configuration.

We've raised neo4j/neo4j#12318 for the actual performance regression.

We've not raised a PR for this because it's not clear how you might want to go about specifying this configuration. We're happy to make the PR once we know we're putting the config in a sensible place!

johnymontana commented 5 years ago

I suppose the options are

  1. to add this as a configuration option to makeAugmentedSchema and augmentSchema so this would be applied to every generated query, or
  2. to make it more fine-grained for certain Query/Mutation fields with some sort of optional schema directive.

Would you want fine-grained Query/Mutation field-specific control over this or just a blanket "apply to all generated queries" approach?

neilprosser commented 5 years ago

For our use-case (which was probably pretty unusual) we found it easiest to apply to all generated queries. Perhaps that's the best way to start with this and then see whether anyone would get any benefit from being able to apply it in a more fine-grained way.

michaeldgraham commented 3 years ago

https://github.com/neo4j-graphql/neo4j-graphql-js/issues/608