neo4j / graphql

A GraphQL to Cypher query execution layer for Neo4j and JavaScript GraphQL implementations.
https://neo4j.com/docs/graphql-manual/current/
Apache License 2.0
497 stars 147 forks source link

Schema and Resolver Pre-compile #3836

Open AccsoSG opened 1 year ago

AccsoSG commented 1 year ago

Is your feature request related to a problem? Please describe. Schemas and resolvers are regenerated at every server startup. Especially with a large schema, this leads to long startup times.

For use cases like autoscalling and cold starts (serverless) this is a big problem. The startup can take several seconds for large schemas, making the use of autoscalling and cold starts impractical.

Describe the solution you'd like As already discussed in https://github.com/neo4j/graphql/issues/243 (@mathix420) the possibility of a pre-compile would be perfect to solve this problem. For example, this could be solved via a specialized Neo4j GraphQL plugin for graphql-codegen.

Describe alternatives you've considered ?

jroith commented 1 year ago

I totally agree, for me this is also a very big issue.

hadyrashwan commented 1 year ago

yes me too. neo4j services are the slowest from my side.

mathix420 commented 1 year ago

This is an issue for me as well, but this issue is a duplicate of https://github.com/neo4j/graphql/issues/243, please express your interest there by adding a reaction (👍) to the first post.

AccsoSG commented 1 year ago

@mathix420 Actually, I disagree a little bit. I don't think it's a duplicate. Partially the same thing is talked about in 243, but the main problem there is the fact that the generation is slow and that it happens twice. Look at the title of the ticket and the labels. We are not interested in increasing the performance of the generation, but in precompiling the schema. The actual idea is unfortunately hidden in the comments of the ticket.

I just put the discussion topic in a new ticket and marked it as a feature request.

Nevertheless, I would also like the problem to be addressed, as it could be a showstopper if it is not solved. I have therefore of course also left my thumbs up there. 👍

mathix420 commented 1 year ago

Got it, so you might be interested by my comment there https://github.com/neo4j/graphql/issues/243#issuecomment-1717680199

zprobst commented 3 months ago

Pre-compilation like this is also useful for tooling that takes schema / type-defs for explorer views, internal tooling, etc.